Jump to content
  • Advertisement
Sign in to follow this  
lazy_rob

Problems with sdl in dev-cpp

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

hey everyone i have a small amount of experience with cpp and i'm trying to follow some tutorials on basic 2d game programming using SDL. i'm using dev cpp and when i try to compile, i'm getting a whole list of linker errors: [Linker error] undefined reference to `SDL_Init' [Linker error] undefined reference to `SDL_GetError' [Linker error] undefined reference to `SDL_Quit' [Linker error] undefined reference to `SDL_SetVideoMode' [Linker error] undefined reference to `SDL_GetError' [Linker error] undefined reference to `WinMain@16' i've looked around and the only tips i can get seem to be about including "-Imingw32 -ISDL -ISDLmain" (no quotes i know) into the linker parameters, which i've done. i'm pretty sure i've got the SDL stuff downloaded properly (lib stuff, include stuff, sdl.dll in with the executable etc), but it is still not working. any help would be greatly appreciated cheers

Share this post


Link to post
Share on other sites
Advertisement
Those are linker errors, not compiler errors. You need to add "-lSDL -lSDLmain" (without the quotes) to the linker options.

Share this post


Link to post
Share on other sites
in project->project options->parameters you need to make sure that you have these lines in the linker box:

-lmingw32
-lsdlmain
-lsdl
-mwindows

Share this post


Link to post
Share on other sites
yep got all those, still not working. got "-Iming32" in the linker options as well, but still nothing.

any more help would be great

Share this post


Link to post
Share on other sites
-I should be -l, as in undercase L

They should also be in that precise order. You can simply copy and paste them in if you want to be sure. I tried it. It worked for me.

Share this post


Link to post
Share on other sites
okay that's really embarrassing. i'd put them all in as upper case i, not lower case L

it's working fine now, so if we all just move swiftly along and forget this little experience ever happened...

rob

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!