LNK2005 errors |
Post Reply |
Author | |
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Posted: 02 July 2009 at 12:18pm |
I'm getting a ton of errors like:
FreeImage.lib(png.obj) : error LNK2005: _png_set_sig_bytes already defined in ToolkitPro1122vc71S.lib(png.obj) Because both libraries I'm trying to link with statically include their own internal libpng. Is there a way to work-around this, or have Codejock hide the png symbols internally so they don't conflict? |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
You're obviously using FreeImage, which links to png.lib - so does XTP. There are a couple of solutions:
1) Remove png-sources from XTP and recompile.
2) Remove png-sources from both XTP and FreeImage, and recompile png.dll for dynamic linking.
I believe you can tell the compiler which lib to use, but I don't remember the switch.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Btw, how good is FreeImage compared to other libraries, such as CxImage and MFC CImage?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
|
Remove from FreeImage = program crash. I removed the png/zlib stuff from XTP and my app appears to work now. FreeImage has the newer of the libpngs anyway. I wasn't sure if I'd break some Skin or other stuff in XTP by making it link to FreeImage's copy of libpng though.
FreeImage compiles under Linux and OS X as well as Windows, and has a very simply C (not C++) interface. I like the easy syntax of just calling a single function to load a file, and getting easy access to raw 32bit RGBA buffers. I've never used CxImage, but I looked into ImageMagick and IM was very complex and full of stuff I didn't need. FI can also load from memory very easily. I don't know if CxImage was around when I started using and contributing to FreeImage, but at quick glance, it looks more similar to ImageMagick to me - full of complex cruft that I don't need. CImage requires GDIPlus, which pretty much throws it out the window as far as portability goes, and I think that means you can't even assume your app would work under Win2000 either. Most of my apps have a "core" that compiles and runs under OS X, with only a thin layer of GUI wrapper on top that has to differ between OS X and Windows builds. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Think most easy way was replace all png files from FreeImage to Toolkit to be sure they all same.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |