Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - LNK2005 errors
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

LNK2005 errors

 Post Reply Post Reply
Author
Message
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Topic: LNK2005 errors
    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?

Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2009 at 12:51pm
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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2009 at 12:52pm
Btw, how good is FreeImage compared to other libraries, such as CxImage and MFC CImage?
PokerMemento - http://www.pokermemento.com/
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2009 at 1:03pm
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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2009 at 1:21am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.281 seconds.