c++ - Add to Path Visual Studio Release Build -


background: have program links third party library. there 2 versions of library, have created 2 solutions point same code. may seem odd, code doesn't have different. settings within solution need different (i.e. library names different , crt version different).

  • solutiona uses versiona of third party library (uses crt version 8.0).
  • solutionb uses versionb of third party library (uses crt version 9.0).
  • both solutiona , solutionb point same code.

i have set macro in project property sheets points correct version of library. library files not located within solution folders. macro allows projects build correctly.

in order executable run, have tell third party libraries located. in order this, can go configuration properties-> debugging -> environment , add path libraries %path% environment variable.

question: works fine limited debug mode. how can add %path% environment variable in release mode? can done using project property sheets?


notes: when program deployed, batch file sets environment before runs. however, able run release executable within visual studio keep things consistent (it easier other developers).

someone ask why don't have libraries in solution folders or why don't throw them in executable. hesitant because 1 version of libraries takes 180 mb. need 2 versions right now, sure change.

you not need create separate solutions separate properties. 1 solution, can create several configuration. each configuration have own compile parameters.

right click on project -> properties -> configuration manager -> new. 

regarding "this works fine limited debug mode". yes, setting parameters debug mode only. normal works in debug mode only.

for libraries, if static:

properties -> linker -> input -> additional dependencies  properties -> linker -> general -> additional library directories 

Comments