Setting up Dev C++ and SDL for PC

Dev C++ is a good, free compiler, that works a bit better than MSVC for SDL. Make sure you have downloaded the SDL pak from Bloodshed. You can read the Dev C++ site for troubleshooting your setup, I will not be covering the basic set up here (installing etc).



Start a new project

To start a new project, open Dev C++, go to file - new - project. You should see 3 tabs, choose - multimedia- SDL (name your project) It will ask you to save your dev c++ project - name it - make sure you save it in the directory you'll be working with.

It'll open a main.cpp. To see if your dev environment is working properly, go up to execute and compile and run. If Dev C++ is set up, the example should run. If its running, close it and go onto the next step. If not, refer to the Dev C++ website for help as I would not have a clue why it didnt run (because it should)

You'll want to delete main.cpp from your project now. Right click the tab, and choose close. Next you will want to add all of the project that you are attempting. Go up to Project - Add to project. Choose the files that are required for your project. Once you have all the required Cfiles, you will have to configure Dev C++.

Go to Project - Project Options.

In the Linker Options make sure you have this:

Code:
-lmingw32 -lSDLmain -lSDL -liberty -lSDL_mixer -lSDL_image



Make sure your int main looks like this (it has to be like that for Dev C++):

Code:
int main(int argc, char *argv[])



And point Dev C++ to look for your project directory by adding it through Files and directories ( the same box as setting your linker options) Thats all you have to do for setting up an SDL evironment in Dev C++.

If you are doing anything with NeoCD/SDL you will need to grab KallistiOS 1.1.9/required NEOGEOCD/SDL libs



Please ask permission to copy this tutorial to any site through email or on my forum.
IMR Technology 2003

PAYPAL Donations:

Your help is appreciated!