Monday, February 21, 2011

Setup SDL in code::block


At first download SDL development library from SDL Download page of website  "http://www.libsdl.org/". Download latest version of SDL Development library for MinGW compiler. Details highlighted in below screen shot.

If your are not running on windows then select library respective to your machine.

Now follow below steps to create SDL project.
Step 1:

Unzip the zip file (SDL2-devel-x.x.x-mingw.tar)

Step 2:
 Create a SDL folder in any directory (for eg. c:\SDL).
And make two new folder inside SDL folder rename first as include and second as lib.

Step 3:
Copy the all file from the include folder of unzip file of step 1

and paste to the folder include (for eg. "C:\SDL\include") which you have created
again copy all file from the lib folder of unzip file of step 1
and paste to the folder lib (for eg. "C:\SDL\lib") which you have created
also copy the SDL.dll file from the bin folder of unzip file and paste it
inside "C:\Windows\System32" floder.


Step 4:
Open the code block and create new project.


Step 5:


From project wizard click on SDL project as above image.


click next

Enter project title name ,give path to save project and  project file name will create by default from project title name.
After that click next.

Now give the path for SDL folder that you have created  (for e.g c:\SDL)
Then click next.


click finish.
Finally project is created with sample program, built and run it you will see window as below.



If you see the output as above image then you successfully created the SDL project.



1 comment:

  1. i have problem with this step:

    Now give the path for SDL folder that you have made in c:\SDL
    Then click next.

    ReplyDelete