How to add a path to an executable DLL in a VIsual C ++ Express 2010 project?

I have some external dependencies for loading with my C ++ program, for example boost or other libraries. If these DLLs are not in $ PATH, as soon as I run my program, I received the error message "I can not load the DLL." To make these .DLL load when my program starts, I need to add this path to the library directory. For instance:

PATH=$PATH;c:\boost\lib

It works, but I don't like this stupid solution that makes the global environment dirty. In addition, I have many additional dependencies to add. The worst thing to do is when you have a different version of the dependencies, it is very annoying. For example, here you have project A, it depends on boost1.3.7, to develop it, you need to change PATH

PATH=$PATH;c:\boost1.3.7\lib

And here you need to develop another project B, which depends on boost1.4.4, oh, great .... change the variable

PATH=$PATH;c:\boost1.4.4\lib

As you can see, this is not a smart decision. If you have more than one library for reference, this will be a real nightmare. I want to change the property of the VC ++ project, add this path to the PATH variable only when starting / debugging my program. I tried to add a path to

VC++ Directories -> Executable Directories

, PATH , . , V++ ?

+5
1

, PATH "" ? . , , VS?

, , :

  • DLL (= / )
  • DLL % WINDIR%/system32 ( , )
  • , PATH, VS. VS PATH, PATH .
  • DLL WinSxS, . ()

btw, , :

mklink /J c:/boost c:/boost1.3.7

c:/boost PATH. ,

+1

All Articles