Question

Suppose that I have a 64 and a 32 bit version of a certain library (VC++, VS2013)

(I would really appreciate it if this fact would not draw away attention from the question itself)

Now, Suppose that I have a project that is also compiled under the two latter platforms

Is there a way in which I can make the IDE/linker use the 32 bit version of the library when compiling the project under the 32 bit platform, and of course, using the 64 bit library when compiling under the 64 bit version

Thanks in advance

Eyal Perry

Was it helpful?

Solution

Recall that all project settings are per configuration/platform pair. When working with Project Properties dialog, pay attention to Configuration and Platform drop-downs at the top.

So, under Linker > Input > Additional Dependencies, simply mention 32-bit LIB file for Win32 platform, and 64-bit LIB for Win64 platform.

OTHER TIPS

You need not to include your library name twice (or as many time your platform or config), as it will be same. Additional lib directory needs to be changed.

Properties->(Select configuration="All Configuration" platform="All Platforms")->Linker->Input->Additional Dependencies->(Include your lib name - which will be same, for x32, x64, release, debug...)

What you really want to change is additional library path! as below:

Properties->(Select configuration="release or debug " platform="win32")->Linker->General->Additional library Directories->Provide here win32 lib directory.

Repeat this for platform x64 givign respective directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top