65.9K
CodeProject is changing. Read more.
Home

How to build an image (DLL/EXE) when two of its included libraries have the same symbol (say function/variable) using VC++

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Jan 24, 2012

CPOL
viewsIcon

7720

As stated by many, the inclusion of /FORCE:MULTIPLE switch may lead to unexpected scenarios (even though the code will compile and link) and as an alternative we can build a DLL wrapper [as hinted by dvpsun] over any of the static lib and can invoke the repeated function via this wrapper...

As stated by many, the inclusion of /FORCE:MULTIPLE switch may lead to unexpected scenarios (even though the code will compile and link) and as an alternative we can build a DLL wrapper [as hinted by dvpsun] over any of the static lib and can invoke the repeated function via this wrapper DLL. Remember to load the DLL using LoadLibrary(...) and not by including it as additional lib. Then we can use GetProcAddress(...) to get the pointer to the function in this wrapper and invoke it.