문제

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)?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top