Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C++

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

5.00/5 (1 vote)
24 Jan 2012CPOL 7.7K  
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)