Jump to content
  • Advertisement
Sign in to follow this  
Dr.Champ

Dev cpp with SDL in windows 7

This topic is 2561 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 have just started learning SDL ...... i downloaded SDL files and extracted to c drive. Then i connected the directories like include files and lib files...... and just compiled simple code

[font="'Arial Black"]#include "SDL/SDL.h"int main( int argc, char* args[] )[/font]
[font="'Arial Black"]{ SDL_Init( SDL_INIT_EVERYTHING ); [/font]
[font="'Arial Black"] SDL_Quit(); [/font]
[font="'Arial Black"] return 0; [/font]
[font="'Arial Black"]}

[color="#696969"]i got linker errors like
- [Linker error] undefined reference to `SDL_Init'
- [Linker error] undefined reference to `SDL_Quit'
- [Linker error] undefined reference to `WinMain@16'
- ld returned 1 exit status


can u guyz help me?[/font]

Share this post


Link to post
Share on other sites
Advertisement

I have just started learning SDL ...... i downloaded SDL files and extracted to c drive. Then i connected the directories like include files and lib files...... and just compiled simple code

[font="Arial Black"]#include "SDL/SDL.h"int main( int argc, char* args[] )[/font]
[font="Arial Black"]{ SDL_Init( SDL_INIT_EVERYTHING ); [/font]
[font="Arial Black"] SDL_Quit(); [/font]
[font="Arial Black"] return 0; [/font]
[font="Arial Black"]}

[color="#696969"]i got linker errors like
- [Linker error] undefined reference to `SDL_Init'
- [Linker error] undefined reference to `SDL_Quit'
- [Linker error] undefined reference to `WinMain@16'
- ld returned 1 exit status


can u guyz help me?[/font]


Its not enough to add the include and library directories, you need to also add the libraries, add -lSDLmain -lSDL to your project options.

Share this post


Link to post
Share on other sites
Dev-Cpp was good in the Win95 era. You are a bit late to use it, especially with Windows7. By the way, this kind of question appear every few weeks or so on this forum. Where do you guys come from? Which tutorial/school teach you to use Dev-C++? Maybe we should stop it at the source.

Share this post


Link to post
Share on other sites
One other suggestion before you get too deep, check out sfml instead of SDL. It's a more fully featured library, and, it uses HW Acceleration for graphics and Sound (sits on OpenGL and OpenAL).

sfml-dev.org They also have a tutorial on setting up sfml in Code::Blocks

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!