Setting up SDL in Dev C++
Last Updated 6/30/08
1)First thing you need to do is download SDL headers and binaries.
You will find them on the SDL website, specifically on this page.
Scroll Down to the Development Libraries section and download the Mingw32 development library
Open gz archive and there should be a *.tar archive inside.
Open the *.tar and there should be a folder inside of that.
Open the folder and it'll contain a bunch of subfolders.
2)Copy the contents of the lib subfolder to the Dev C++ lib folder.
The Dev C++ lib folder should be at C:\Dev-Cpp\lib.
3)Next copy the contents of the bin subfolder to the Dev C++ bin folder.
It should be at C:\Dev-Cpp\bin.
4)After that, open the include subfolder in the archive and extract the folder named "SDL" to the Dev C++ include folder, which should be at C:\Dev-Cpp\include.
Note: Some versions of SDL won't have a folder named "SDL" in the archive's include subfolder, but just a bunch of header files. To get around this simply create a folder named "SDL" in your Dev C++ include folder and copy all the header files from the archive to that folder you made.
5)Now take the SDL.dll from the archive (it should be inside the bin subfolder) and extract it. You're going to put this in the same directory as your exe when you compile it.
Alternatively, you can copy it to C:\WINDOWS\SYSTEM32 so your SDL app will find SDL.dll even if it's not in the same directory. The problem with this method is if you have multiple SDL apps that use different versions of SDL, you'll have version conflicts. If you have SDL 1.2.8 in SYSTEM32 when the app uses 1.2.13 you're going to run into problems. Generally you want to have your SDL.dll in the same directory as your executable developing and you'll always want to have SDL.dll in the same directory as the exe when distributing your app.
6)Now start up Dev C++ and start a new empty project.
7)Go to the project options.
8)Under the General tab, set type to Win32 GUI.
This is to make sure a console window does not pop up.
9)Under the Parameters tab, paste:
10)Add source new source file to the project.
11)Paste the following code into the new source file:
You will find them on the SDL website, specifically on this page.
Scroll Down to the Development Libraries section and download the Mingw32 development library

Open gz archive and there should be a *.tar archive inside.
Open the *.tar and there should be a folder inside of that.
Open the folder and it'll contain a bunch of subfolders.
2)Copy the contents of the lib subfolder to the Dev C++ lib folder.
The Dev C++ lib folder should be at C:\Dev-Cpp\lib.
3)Next copy the contents of the bin subfolder to the Dev C++ bin folder.
It should be at C:\Dev-Cpp\bin.
4)After that, open the include subfolder in the archive and extract the folder named "SDL" to the Dev C++ include folder, which should be at C:\Dev-Cpp\include.
Note: Some versions of SDL won't have a folder named "SDL" in the archive's include subfolder, but just a bunch of header files. To get around this simply create a folder named "SDL" in your Dev C++ include folder and copy all the header files from the archive to that folder you made.
5)Now take the SDL.dll from the archive (it should be inside the bin subfolder) and extract it. You're going to put this in the same directory as your exe when you compile it.
Alternatively, you can copy it to C:\WINDOWS\SYSTEM32 so your SDL app will find SDL.dll even if it's not in the same directory. The problem with this method is if you have multiple SDL apps that use different versions of SDL, you'll have version conflicts. If you have SDL 1.2.8 in SYSTEM32 when the app uses 1.2.13 you're going to run into problems. Generally you want to have your SDL.dll in the same directory as your executable developing and you'll always want to have SDL.dll in the same directory as the exe when distributing your app.
6)Now start up Dev C++ and start a new empty project.

7)Go to the project options.

8)Under the General tab, set type to Win32 GUI.
This is to make sure a console window does not pop up.

9)Under the Parameters tab, paste:
-lmingw32 -lSDLmain -lSDL
in the linker.
10)Add source new source file to the project.

11)Paste the following code into the new source file:
#include "SDL/SDL.h"
int main( int argc, char* args[] )
{
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Quit SDL
SDL_Quit();
return 0;
}
12)Now Compile. Save the new source file if necessary and make sure
SDL.dll is in the same directory as the executable. If there are no errors, you're finished. Otherwise go back and
make sure you didn't skip a step.