Jump to content
  • Advertisement
Sign in to follow this  
EmrldDrgn

Error in SDL program

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

When compiling an SDL program, I was getting an "unresolved external symbol" error, as well as a few warnings. The errors/warnings are: Warning 4 warning LNK4217: locally defined symbol _fclose imported in function _cleanup_output SDLmain.lib Warning 5 warning LNK4217: locally defined symbol _exit imported in function _main SDLmain.lib Warning 6 warning LNK4217: locally defined symbol _strrchr imported in function _main SDLmain.lib Error 7 error LNK2019: unresolved external symbol __imp__fprintf referenced in function _ShowError SDLmain.lib Error 8 fatal error LNK1120: 1 unresolved externals C:\Users\Andrew\Documents\Visual Studio 2008\Projects\OpenGLProgram\SDL\OpenGLProgram.exe I changed the "Runtime Library" property to "Multithreaded DLL", as I saw on the Internet, and these errors went away, replaced by this one: Error 1 fatal error LNK1561: entry point must be defined OpenGLProgram I am clearly defining an int main function as follows: int main(int argc, char *argv[]) which is what it said to do on the SDL page. Why isn't it working? EDIT: Yes, I am including SDL.h in my main.cpp file. [Edited by - EmrldDrgn on February 5, 2008 12:22:27 AM]

Share this post


Link to post
Share on other sites
Advertisement
I don't think I can determine the problem from all that info. I need you to be more vague.

Share this post


Link to post
Share on other sites
Quote:
Original post by SilentKiller
Try

int main(int argc, char** argv)


Also check that you're linking sdl.lib and sdlmain.lib


char** argv is the same as char* argv[], so nothing would change.

To the original poster: Make sure you've setup SDL as described in this article: Setting up SDL in Visual Studio 2005

EDIT: I know you're using VS2008, but this article worked for me using VS2008 as well.

Share this post


Link to post
Share on other sites
Also check your project properties.
If it is a console application the compiler expects a main(int,char**),
And if it is set to Win32 then you need to define WinMain.

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!