views:

14

answers:

1

hi, am using visual studio for my project, and i need to include a lib/dll in my application. i have included the lib for the same and compiles fine, however when i try to run it, gives me an error saying that it could not find the specified dll, adding this path in the env variable PATH solves the issue, but i do not want to do it everytime and across systems, how can i include this path or a workaround for the same in my .pro file itself?

Thanks in advance, this is a li'l urgent.

A: 

You have this problem because your executable and your dll are in different folders. You probably used the default visual studio setup, which uses $(IntDir) and $(OutDir) in each project folder.

Setup the OutDir for both projects (exe and dll) to be the same folder (e.g. $(SolutionDir)\Build\$(TargetName) ). This way, the binaries resulted when building the solution will be placed in the same folder (different out folders for different targets - Debug/Release).

Cătălin Pitiș