开发者

How do I fix symbol name collision between static libs in Visual Studio/C++?

My platform is Windows / Visual Studio / C++

I have two static .lib files. They are from two different vendors. Unfortunately the lib symbols are colliding on a globally defined symbol that each file defines. They both choose the same name for something. eek!

Is there a way to namespace or "hide" the symbols from the two libraries from each other so they do not conflict?

I know you can set the linker option /FORCE:MULTIPLE but it is not clear what the consequences will be to the libraries when the name conflicts. htt开发者_如何转开发p://msdn.microsoft.com/en-us/library/70abkas3%28v=VS.71%29.aspx


Create a new 'wrapper' static library around one of your targets that exports everything you need using distinct names versus the non-wrapped library.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜