views:

17

answers:

1

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. http://msdn.microsoft.com/en-us/library/70abkas3%28v=VS.71%29.aspx

A: 

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

Steve Townsend
ok thanks. We were looking at wrappering it in a dll.
meissnersd
@meissnersd - either would work, you just have to disambiguate the encapsulated names in one of them.
Steve Townsend