Jump to content
  • Advertisement
Sign in to follow this  
JonathanO'Brien

SDL entry point Linker error in C++

This topic is 2605 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

My compiler is currently returning the following:
error LNK2001: unresolved external symbol __cedcl main(int, char**)

As its only error in Release. It appears to be having an issue with the SDL entry point main.
I have linked all necessary libraries and my runtime is set to /MD.

I receive no errors in debug and fail to understand what could be causing this error.

Thanks a bunch, GDN.

Share this post


Link to post
Share on other sites
Advertisement
Did you set the Subsystem to /Windows in the Debug configuration but forget to set it in the Release configuration?

Share this post


Link to post
Share on other sites
Can you paste the linker command line? I believe it is available somewhere in the Visual Studio linker settings. Consider investigating any differences between your Release and Debug linker command line as possible sources for this error.

Share this post


Link to post
Share on other sites

Can you paste the linker command line? I believe it is available somewhere in the Visual Studio linker settings. Consider investigating any differences between your Release and Debug linker command line as possible sources for this error.

Release

/OUT:"C:\Users\9101757\Documents\Visual Studio 2010\Projects\motion\Release\motion.exe" /NOLOGO "SDL.lib" "SDLmain.lib" "SDL_image.lib" "SDL_mixer.lib" "SDL_ttf.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Release\motion.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\9101757\Documents\Visual Studio 2010\Projects\motion\Release\motion.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /PGD:"C:\Users\9101757\Documents\Visual Studio 2010\Projects\motion\Release\motion.pgd" /LTCG /TLBID:1 /ENTRY:"_cedcl main(int, char**)" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE

Debug
/OUT:"C:\Users\9101757\Documents\Visual Studio 2010\Projects\motion\Debug\motion.exe" /NOLOGO "SDL.lib" "SDLmain.lib" "SDL_image.lib" "SDL_mixer.lib" "SDL_ttf.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Debug\motion.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\9101757\Documents\Visual Studio 2010\Projects\motion\Debug\motion.pdb" /SUBSYSTEM:WINDOWS /PGD:"C:\Users\9101757\Documents\Visual Studio 2010\Projects\motion\Debug\motion.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE

Share this post


Link to post
Share on other sites

/ENTRY:"_cedcl main(int, char**)"

Your release settings contains an explicit entry point, but your debug does not. A quick glance at the SDL documentation suggests to me that SDL provides the actual entry point as WinMain and "overloads" your own main function. Remove the entry point setting, unless there's a reason you've defined another entry point of course.

Share this post


Link to post
Share on other sites
<br>[quote name='A1P4A_0M3GA' timestamp='1306968378' post='4818446']<br>/ENTRY:"_cedcl main(int, char**)" <br>
<br>Your release settings contains an explicit entry point, but your debug does not. A quick glance at the SDL documentation suggests to me that SDL provides the actual entry point as WinMain and "overloads" your own main function. Remove the entry point setting, unless there's a reason you've defined another entry point of course.<br>[/quote]<br><br>Thanks, that worked. I think I set that entry point because of advice I read elsewhere on the internet. Thankyou very much!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!