Stefano
Stefano

Reputation: 790

VC6 linking conflict

I have an old c++ project compiled with VC6.

I need to statically link a new library to implement a new functionality.

Unfortunately the new library define a symbol (i.e. _inflate) that is already defined in a previously linked static library.

Of course I cannot get rid of either library, and of course I have no access to the library's source code.

Is there a way to avoid the linker error (LNK2005)?

Upvotes: 3

Views: 189

Answers (1)

Jason Williams
Jason Williams

Reputation: 57902

If you know that the two versions of _inflate are identical, or at least "compatible", then you can use the /FORCE:Multiple linker option to force it to ignore name clashes.

Of course, if it links to a version of that code that is "incompatible" in any way it could cause undefined behaviour.

Upvotes: 3

Related Questions