Click here to Skip to main content
15,886,199 members
Articles / Programming Languages / C++
Alternative
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
24 Jan 2012CPOL 7.6K   1  
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)


Written By
Technical Lead
India India
_____________________________________________________________

Did my masters from IIT-M in Advanced Manufacturing Technology and working mainly on C++ in CAD domain from 2004 onwards.
Working on web technologies using Angular 7.0 and above, HTML5, CSS3 from 2015.

Comments and Discussions

 
-- There are no messages in this forum --