Sign in to follow this  
isenthalpic53

LNK2019

Recommended Posts

Not sure if this is an inappropriate place to put this question. I have been trying to add jpeg loading code to an MFC application in Visual Studio 2005. I'm not sure if I'm linking in a bad order or using improper compiler options, etc. I've been poking around for well over an hour, I'm sure this is something minor, but when I add my texture loading code, which uses jpeg.lib, I get the following error:
Quote:
1>jpeg.lib(jerror.obj) : error LNK2019: unresolved external symbol __iob referenced in function _output_message 1>.\Debug/Viewer.exe : fatal error LNK1120: 1 unresolved externals
Any ideas?

Share this post


Link to post
Share on other sites
I quick google search of "__iob" gives good result. I had this problem (not the same function and not the same libraries though) a while ago. Your jpeg.lib was compiled using a static build under a older version of VS, and you try to compile your executable with multi-threaded runtimes libraries (you know the /MT /MD switchs, and the libcp.lib/libcmt.lib libraries). I'm no expert with those, and I don't know if there's a easy way to fix your problem so I won't try to say shit i'm not sure about, but what I'm sure is that if you could recompile jpeg.lib using VS2005/2008 it would probably be ok afterward. Or compile your own project with an older version of VS, but I wouldn't recommend that.

Share this post


Link to post
Share on other sites
I recompiled the jpeg.lib with VS 2005. I could build the application if I statically linked to MFC, but that inflated my binary to 3 MB, up from about 200KB.

If anyone's interested, I've included the updated .h and .lib files here:

http://www.yourfilehost.com/media.ph...eglib_VS2005.h
http://www.yourfilehost.com/media.ph...peg_VS2005.lib

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this