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]
Dev cpp with SDL in windows 7
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.
1) Toss Dev-Cpp
2.a) Get Code::Blocks and have a look here: http://wiki.codebloc...th_Code::Blocks
2.b) Get Microsoft Visual Studio Express and have a look here: http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet0508e/index.php
2.a) Get Code::Blocks and have a look here: http://wiki.codebloc...th_Code::Blocks
2.b) Get Microsoft Visual Studio Express and have a look here: http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet0508e/index.php
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.
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
sfml-dev.org They also have a tutorial on setting up sfml in Code::Blocks
Essential reading: http://www.jasonbadams.net/20081218/why-you-shouldnt-use-dev-c/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement