Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Annoying linker error!

This topic is 2297 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been trying for the past week to implement 3DS static meshes into my OpenGL project, and finally came across lib3ds to help me do the job. I was going with the FBX SDK for a while, but I needed something a little more lightweight and better suited for OpenGL.
And for textures, I decided to go with a mix of Win32 API and SOIL.
Since this is primarily a side project to test these features before adding them to my main project (a standalone, dialog-based plugin DLL with embedded resources), I needed to be sure that everything is statically linked so that no additional dependencies will be neccesary on the user's machine.

So I compiled lib3ds (v1.2.0) as a static lib, then added it to my MFC test app.
Then, I compiled SOIL (VC9 version) as a static lib, and added that as well.

Upon compiling my project, I got several LNK2005 errors in reference to libcmt.lib and msvcrt.lib, so I added those to the list of ignored libraries (Linker -> Input -> Ignore Specific Default Libraries).
But when I do that, I am left with the following output:

Warning 1 warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification c:\projects\3ds\loader\loader\LINK
Error 2 error LNK2001: unresolved external symbol __imp__strstr c:\projects\3ds\loader\loader\soil.lib(SOIL.obj)
Error 3 error LNK1120: 1 unresolved externals c:\projects\3ds\loader\Debug\loader.exe

If I don't link to SOIL, all of these problems go away (except of course that I cannot use SOIL). But why am I getting an error linking to the library when it built into a static library just fine without that same error?

Share this post

Link to post
Share on other sites
Hrmm, well I recompiled SOIL using Multi-threaded (/MT) instead of Multi-threaded DLL (/MD) and now it seems to work.
Or, at least, I'm not getting any compiler/linker errors in my app. Edited by Rectangle

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!