Sign in to follow this  

MSVC++ Release Build: Unresolved Externals with SDL

This topic is 3595 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 finished a project so I'm trying to do a release build. I know doing a release build is a bit different from a debug build but I've never done this before and a bit of Googling hasn't really made it any clearer... I get 23 unresolved externals when I build, all of which are related to SDL. The output is like this:
1>game.obj : error LNK2001: unresolved external symbol _SDL_FreeSurface
...
etc.
...
1>graphics.obj : error LNK2001: unresolved external symbol _IMG_Load
1>MSVCRTD.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Changing the Runtime Library in the Code Generation in Properties gives the same result. Obviously there's some kind of linking problem with the SDL stuff, but how exactly do I fix it? And out of curiosity, how does it work fine in Debug mode?

Share this post


Link to post
Share on other sites
Did you add SDL.lib and SDLmain.lib to the additional libraries section of your project properties? Doing it for the debug build won't carry over to the release build.

Share this post


Link to post
Share on other sites
There is most likely some library missing in the Release configuration. Check Linkers's Input for additional libraries and add in Release configuration the libraries you see there when Debug build configuration is selected. I say this because I do not know SDL. Usually there are different libraries to linked with in debug and release builds, you may have to check that one out in the SDL help.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Did you add SDL.lib and SDLmain.lib to the additional libraries section of your project properties? Doing it for the debug build won't carry over to the release build.


Hmm... I did not know that ^_^

I just assumed it kept the same settings. Nice, it works fine now.

Thank you very much...

Share this post


Link to post
Share on other sites
When you open the project property dialog, there's a drop down box labeled "Configuration". This determines which configuration you are editing. If you want your edit to apply to both Debug and Release builds, you should change it to "All Configurations". (Provided, of course, that you only have Debug and Release configuration. If you have more than that you'll need to use Multiple Configurations instead.)

Share this post


Link to post
Share on other sites

This topic is 3595 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.

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