Monday, February 21, 2011

Setup SDL 1.2 version in code::block

Visit SDL download page Download file SDL-devel-1.2.15-mingw32.tar.gz (Mingw32) from Development Libraries section for your respective machine Win32/Linux. If you are using Visual C++ compiler in Code:blocks then download another file for Visual C++. Required links are highlighted in screen shot below:

Steps to create SDL project in Code::blocks:
Step 1: Extract downloaded  zip file (SDL2-devel-x.x.x-mingw.tar).

Step 2: Create folder in any directory and give a name SDL 1.2 (eg. c:\SDL 1.2).

Step 3: Browse extracted files in step 1. Copy "include" and "lib" folders and paste it inside the directory that you have created in step 2. Also copy SDL.dll file from bin folder to "C:\Windows\System32" folder.

Step 4: Open the code::block and go to File -> New -> Project or click create a new project link from start page.

Step 5: From project wizard select "SDL project" and click Go button and click Next button if SDL project welcome window appear.

Enter necessary details and click Next button.

Now, enter the path for SDL library location that you have created in step 2. (e.g c:\SDL 1.2) and click Next button.

Click Finish button.

Finally you have created project successfully.

Now built and run it you will see output as below.

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.