Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming conflicts between different libraries

Tags:

c++

I'm trying to compile my program with two statically linked libraries: SFML and PhysFS. However, at the linking phase I get the following errors:

eror LNK2005: _inflatePrime already defined in sfml-graphics-s.lib(inflate.obj)
error LNK2005: _inflateGetHeader already defined in sfml-graphics-s.lib(inflate.obj)
error LNK2005: _adler32_combine already defined in sfml-graphics-s.lib(adler32.obj)
error LNK2005: _crc32_combine already defined in sfml-graphics-s.lib(crc32.obj)
error LNK1169: one or more multiply defined symbols found

What should I do when two entirely unrelated libraries have this kind of conflicts?

Edit: Oh please-please tell me I'm not going to have to write a wrapper. I'm so tired of having to get things to work, I just want to write my own code already. :(

like image 423
Paul Manta Avatar asked Jun 04 '11 13:06

Paul Manta


1 Answers

Both libraries seems to have preferred to include the zlib library instead of having a dependency on it. I'd try to build them without this inclusion and link the executable with zlib.

like image 97
AProgrammer Avatar answered Oct 23 '22 12:10

AProgrammer