I'd like to make a x86 and x64 version of my application because some of the libraries I'm using have differences for x86 and x64 (e.g. SQLite). I made a new configuration for release builds that has as target operating system "x64".
Is there a way to define different DLLs for the configuration e.g. use SQLite.dll for x86 release and SQLite64.dll for x64 release?
- Unfortunately I can't use the "any platform" option which is default because of those not x64 compatible DLLs.
- I want to support real x64 and not running a 32 bit application on an x64 OS.
You need a condition to the dll reference in the project file.
This will cause visual studio to recheck the condition and reference whenever you change the active configuration.
Just add a condition for each configuration.
Example:
Which VS version? Which language are you developing in? If native (=not managed) C++, practically all settings, including used libraries can be set differently for each configuration. In the top of the project properties dialog, just choose which configuration's settings would you like to modify.
You can add conditions to the dll references in the project file but you cannot do it using Visual Studio - you will have to hand-edit the project files. See this for how to do it.
What you need to do is to include a reference to the 32-bit dll only in the 32-bit build configuration, and a reference to the 64-bit dll in the 64-bit build configuration.