Public Group

# MSVC++ Release Build: Unresolved Externals with SDL

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

## 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 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 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 on other sites
Quote:
 Original post by SiCraneDid 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 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.)

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 41
• ### Forum Statistics

• Total Topics
632634
• Total Posts
3007556
• ### Who's Online (See full list)

There are no registered users currently online

×