AnsweredAssumed Answered

How to change library based on configuration

Question asked by kenfred on Feb 23, 2010
Latest reply on Feb 25, 2010 by kenfred

I am wondering if it is possible for the compiler to automatically link against a library based on the build configuration.  Lets say I have a library (myLib.dlb) and an executable (myProgram.dxe).  I would like to be able to go the the build options of myProgram.dxe, select "Debug" as my configuration and automatically link against the Debug version of myLib.dlb.


To compare against another compiler/linker, Visual C lets you accomplish this with project dependencies.  If I have myLib and myProgram in the same solution and name myLib as a dependency of myProgram, the linker automatically links against myLib and finds the Debug or Release version in their respective folders.  Which one is used is based on the configuration of myProgram.


As a contrast, VisualDSP forces me to go into the project options and define the Debug/Release/DebugNWC/ReleaseNWC folders of myLib in each assocciated configuration of myProgram.  But even after doing this, it can't link against the library unless you add the library to your linker files.  However, when you do this, you add the library from an absolute location.


How can I add libs from relative paths and is the compiler smart enough to pick the library version based on the programs configuration?