Download and install Dev-C++ (http://www.bloodshed.net/devcpp.html), and be sure to get the version that includes MinGW.
On the SDL (http://www.libsdl.org) download page, get the latest version of the MinGW development libraries.
If you want to use the SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/) library (for sound and music), download the Windows development libraries for SDL_mixer. (At the time of this writing, MinGW specific libraries are not available on the SDL_mixer website (http://www.libsdl.org/projects/SDL_mixer/), but the VC6 libraries will work with Dev-C++.)
- Uncompress the SDL and SDL_mixer libraries to your local drive.
- Copy SDL.dll and libSDLmain.a from the SDL library into the \lib subdirectory of your Dev-C++ installation root.
- Create an \SDL directory in the \include subdirectory of your Dev-C++ installation root, and copy all of the SDL header files into this new directory.
- Copy SDL_mixer.dll from the SDL_mixer library into the \lib subdirectory of your Dev-C++ installation root.
- Copy the SDL_mixer.h header file into the \include\SDL subdirectory of your Dev-C++ installation root.
Your build environment is now set up. To create an SDL project, perform the following steps.
Open Dev-C++ and from the File menu, select New→Project.
- Click on the Empty Project icon, give your project a name, and click Ok.
- Use the file browser to decide where to save your project's DEV file, and click Save.
- Under the Project menu, select Project Options.
- Click the Parameters tab, and in the Linker textbox enter "-lmingw32 -lSDLmain -lSDL -lSDL_mixer" (without the quotes) then click Ok.
- NOTE: If you do not want the console window to appear when your program runs, you will need to add -mwindows to the end of your linker string!
- You can now use Dev-C++ to add your source code to the project. When you're done, from the Execute menu, select Compile. This will create an executable file in your project's root directory.
- Before you can run the executable, you will need to copy SDL.dll and SDL_mixer.dll to your project's root directory, or if you prefer, you can copy the two DLLs to your \windows\system or \windows\system32 folder. Windows must be able to find the DLLs, or you'll get an error when you attempt to run the executable.