Jump to content
  • Advertisement
Sign in to follow this  
Rowen

Problem getting SDL to work with Dev-C++

This topic is 5460 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 every1 I'm new to SDL and need some help... I want to get started with SDL, but I can't get it to work There's what I got: - Dev-C++ version 4.9.9.0 From www.libsdl.org I clicked on "SDL 1.2" and under runtime libraries I downloaded: - SDL-1.2.7-win32.zip ...and under developpement libraries I picked: - SDL-devel-1.2.7-VC6.zip and... - SDL-devel-1.2.7-mingw32.tar.gz (only VC6.zip has library and include files) I copyed all files in both library and include from SDL to the folders of Dev-C++ Then I started a new project and went to "Project Options" and under "Parametres" in the "Linker" box I wrote: -lmingw32 -mwindows -lSDLmain -lSDL remember I have version 4.9.9.0 (the letter in th beginning is an l as in light or lame) I wrote: Code: #include <iostream> #include <stdlib.h> #include <SDL/SDL.h> using namespace std; int main(int argc, char *argv[]) { system("PAUSE"); return 0; } I tried to compile but it outputs errors: SDL/SDL.h: No such file or library [Build Error] [main.o] Error 1 I followed these instructions: http://cone3d.gamedev.net/cgi-bin/i...ls/gfxsdl/index Still it doesn't work plz help!!!

Share this post


Link to post
Share on other sites
Advertisement
Don't use VC's files, different compilers don't seem to play well with each others' files. Use only the mingw compiler include files, and make sure you put an SDL.dll into your bin folder of Dev-C++.

Keep asking questions, you'll keep getting answers.

Share this post


Link to post
Share on other sites
You need to make sure the SDL headers are in the include path. Go to project options and directories. Hit the include tab and hit add, go to your SDL directory and select the include one. and add it. Now just say #include <SDL.h> and it should work.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ty very much!

I'll try some of those things :)

Share this post


Link to post
Share on other sites
Nope...
Doesn't work:

In the dl SDL-devel-1.2.7-mingw32.tar.gz I tried to add the SDL.dll file to "include", but it doesn't work becase I can't select the seperate file (SDL.dll) and add it.

I can only select the folder where both includes and libs are in.

So under "Project Options" - "Directories" - "Library Directory"
I wrote: C:\SDL\Mingw32\SDL-1.2.7-win32
And under "Include Directories" I wrote the same (because of the problem mentioned above)...

I copied SDL.dll into includes in my Dev-C++ folder and
SDL-devel-1.2.7-mingw32.tar.gz under libs...

Get the same errors

PS: No I haven't got that package you mentioned

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!