Skip to main content
GameDev.net gamedev.net
🔒 Locked

LNK2019

Started by isenthalpic53 Nov 22, 2008 at 11:50 AM 1 replies 1k views
Original Post
isenthalpic53
isenthalpic53
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?
Dunge
Dunge
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.
isenthalpic53
isenthalpic53
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.