I have a problem with static libraries. I need to use 2 different versions of the same SDK in one DLL without names collisions. I thought that solution is to make 2 static libs for every version of SDK and then import these libs to DLL. But this solution works strange and I'm not sure why....
simplified situation looks like this:
LIB1 - there is function Add1 which uses things from SDK 1.0
LIB2 - there is function Add2 which uses things from SDK 2.0
DLL- imports LIB1 and LIB2 and there is function Add(float version) which calls Add1 or Add2 - depends on version number in parameter
Compilation process is OK but DLL works only with one version SDK
When I debug it I see that program calls Add function from DLL with version 2.0 in parameter. Then Add really calls Add2 - so this is still right. BUT then inside Add2 function it uses things which are defined in SDK 1.0 instead of SDK 2.0 ! LIB2 is really created with SDK 2.0. (include dirs and lib dirs are set to SDK 2.0)
So why it uses SDK 1.0 ???
Is it because of linker which joins everything together when I create DLL and symbols from SDK 1.0 override symbols from SDK 2.0 ??? (SDKs don't have different namespaces).
Do you have any idea where is problem and is there any solution ???
Thanks a lot!
I use Visual C++ 2010...