Sign in to follow this  

Installing SDL help

This topic is 4165 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 am trying to install SDL for Visual C++ 2005 Express Edition. I've tried to use help from older versions of Visual C++ but I can't seem to figure it out (not sure if I'm doing the right thing). Right now I have the folder SDL-1.2.11 in C, and I think I updated the directories, but it doesn't work. I put: #include "SDL.h" int main( int argc, char* argv[] ) { // Body of the program goes here. return 0; } in, compiled, and... Right now Im getting the errors: MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup C:\Documents and Settings\Mark.MyComputer\My Documents\Visual Studio 2005\Projects\Learning SDL\Debug\Learning SDL.exe : fatal error LNK1120: 1 unresolved externals Anything would be helpful, especially a link to step by step guide to installing it from step 1 if there is one out there. Thanks in advance.

Share this post


Link to post
Share on other sites
Did you set up the directories for include and library files? Did you then link the libraries? If not, someone else had a similar problem earlier today: http://www.gamedev.net/community/forums/viewreply.asp?ID=2692788.

If that didn't help, change you main() function to look more like this:
int main( int, char** )

I haven't used SDL too much, but I know it's picky about that syntax. Perhaps because SDL redefines your main() function via a macro and it depends on that syntax. But don't quote me on that!

EDIT: This doesn't agree with the link given by RedDragon above. Ignore the second half of my post :)

Share this post


Link to post
Share on other sites
Looks like your not linking the sdl libraries

Project->properties->linker->Additional dependencies
add: SDL.lib SDLmain.lib

Also be sure to set it up as a multithreaded dll
Project->properties->C/C++->Code Generation->Multi-threaded dll (/MD)

Share this post


Link to post
Share on other sites
Quote:
Original post by squashed_bug
Looks like your not linking the sdl libraries

Project->properties->linker->Additional dependencies
add: SDL.lib SDLmain.lib

Also be sure to set it up as a multithreaded dll
Project->properties->C/C++->Code Generation->Multi-threaded dll (/MD)


Yup that first thing is what I forgot. Thanks a ton. Is it reccomended or even possible to make this default?

Share this post


Link to post
Share on other sites

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