Sign in to follow this  

Problem setting up SDL with Dev-C++

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

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 http://www.youtube.com/watch?v=d0YZZ3ighK0, 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.

Share this post


Link to post
Share on other sites


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'?

Share this post


Link to post
Share on other sites

 


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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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