tags:

views:

403

answers:

2

I have a large project with several 3rd party libraries. I want to build everything for 32 and for 64 bit architecture. Several libraries create shared libs (dlls). What is the best way to provide those dlls to the compiled executables from my project? I thought off I can put all those dlls into a directory which is added to the PATH variable. But most dlls created from the 3rd party libs are named in the same way under 32 and 64 bit compilation, so I cannot put them in one directory. Can I create two directories, one for the 32 bit dlls and one for the 64 bit dlls and the executable picks the right dlls? Or have you a better idea to let my executable load the right dlls? Thanks!

A: 

The target system is either 32 or 64 bit, never both. You should install only the needed versions based on the bit-ness of the system. Then you just have two non-intersecting sets of binaries and install one set needed for the target system and never have problems detecting what to load at runtime.

sharptooth
Actually, with WOW, a 64 bit system is also a 32 bit system. But you then have both a 32 bits and a 64 bits Program Files directory, so still no mix.
MSalters
Yes it´s true that the target of an executable is either 32 or 64 bit. But I want to be able to target both architectures on our development machines (only for development, not on "customer computers").
yoursort
I guess it's better to just copy the 64-bit executables after compilation into one folder and 32-bit into the other. It's trivial to set it up in almost any development environment and it solves the problem completely.
sharptooth
+1  A: 

Since a 32-bits executable cannot pick 64-bits DLLs and vice-versa. You just have one directory with everything 32-bits (executable + DLLs) and another one with everything 64-bits.

Philibert Perusse