0

I have a managed exe calling a managed dll, both written in c, and compiled using vs2010 c++.

When I run the program I get error that program can't start because the dll is missing from my computer. In the linker, under Linker->Input->Additional dependencies I have added the folder containing the dll lib. Also, in the Linker->General section I have listed the folder under Additional include libraries.

I am clueless...

4

1 回答 1

1

The problem is that the dll was not in the same dir as where the .exe was being executed. However, since I didn't want to manually copy the dll each time, and since it was being used by other .exes, the better solution was to add a post-build event.

One more important note: Afraid of getting nicked with another -1 for asking a bad question, I spent a couple of hours coming up with the magic potion/incantations needed to do such a post-build copy. Here it is. Note the use of the macros, the /Y, and especially the quotes around the whole mess of each pathname.

xcopy /Y "$(SolutionDir)x64\Release\mcDll.dll" "$(SolutionDir)stream\x64\Release"
于 2012-05-08T18:31:31.797 回答