Problem setting up SDL with Dev-C++

Started by
5 comments, last by wintertime 9 years, 4 months ago

Hi there, I came here after searching a lot of articles/forums/tutorials on how to set up SDL 2.0( I have 2.03) in Dev-C++. I have tried all the steps provided in different tutorials over and over such as

, but in vain. I have windows 8.1(32-bit) and I just downgraded Dev-C++(TDM-GCC compiler) to Dev-c++(minGW GCC) hoping that may fix the problem. But it didn't work either.
-I have added include and lib directory in compiler options
-I have placed SDL2.dll in the folder where I have saved project file and cpp file.
-I have used this parameter in linker: -lmingw32 -lSDL2main -lSDL2

There was this code written in tutorial to check if SDL is set up correctly or not:


#include "SDL/SDL.h"

int main( int argc, char* args[] )
{
    //Start SDL
    SDL_Init( SDL_INIT_EVERYTHING );
    
    //Quit SDL
    SDL_Quit();
    
    return 0;    
}

And when I compile it, the following errors show up.
uivTBEX.png

And even if I write code for a Hello world program, it compiles and then nothing happens.
Any help would be appreciated. I just hope this is not a wrong board to post such a question.

Advertisement


Any help would be appreciated. I just hope this is not a wrong board to post such a question.

You really can't go wrong posting in the "Beginner's" forum. :-)

From the error, it looks like you haven't got the header file folder configured correctly.

In the video, the include statement is #include "SDL2/SDL.h", not #include "SDL/SDL.h". It's not that simple is it? Did you forget the '2'?

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532


Any help would be appreciated. I just hope this is not a wrong board to post such a question.

You really can't go wrong posting in the "Beginner's" forum. :-)

From the error, it looks like you haven't got the header file folder configured correctly.

In the video, the include statement is #include "SDL2/SDL.h", not #include "SDL/SDL.h". It's not that simple is it? Did you forget the '2'?

I tried the '2' and it worked, I guess I didn't really pay attention to that part!
When I compile it, it opens the new source file and shows this http://pastebin.com/gsmJMj9t
I guess this was it, thanks a lot for your help.

Not sure if this is still the case or not but I believe Dev C++ has been abandoned. Most people recommend using Code::Blocks or Visual Studio. I've used all three and would say Code::Blocks has better features than Dev C++. Visual Studio has become my favorite although it can be intimidating at first.

It's only a matter of time before someone (cough) recommends QTCreator QtCreator.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

Not sure if this is still the case or not but I believe Dev C++ has been abandoned.


Looking at his post the OP does not appear to be using the horrible useless Bloodshed Dev-C++ but one of the newer forks. I don't have exactly a high opinion of them but too little experience to make a definite recommendation.

And Glass_Knife, the IDE you are looking is called QtCreator (not QTCreator).

He just had a typo, missing a "2". No other IDE would have prevented that, because thats usually a problem with unreadable text in video tutorials.

This topic is closed to new replies.

Advertisement