Learn More

Sunday, July 3, 2011

How To Install SDL In CodeBlocks

SDL
SDL
Previously, we want to assure you that you have downloaded Code::Blocks (read: codeblocks) and SDL. If you do not already do so please read Get Software And Graphics To Create A Game to find out how to get both. Then make sure you have installed on your computer CodeBlocks. Record codeblocks address you have installed. For example, we have installed codeblocks in the computer us at the address C: \ Program Files \ CodeBlocks.

The next step, create a new folder inside the folder that has been installed CodeBlocks. Name the folder with the name of the SDL, inside that folder create two new folders with the name of the include and lib. When finished making it, extract the SDL files that you downloaded at any location in your computer. Our advice would simply lay on the desktop. Furthermore, copies the entire contents of files folder include SDL you have extract. Paste in the include folder which you have previously made in CodeBlocks folder. So that the entire contents of the folder include the inside of your computer has an address of C: \ Program Files \ CodeBlocks \ SDL \ include. Do the same on the contents of the files SDL lib folder you have extract tothe desktop, so that the contents of the lib folder is in your computer has an address of C: \ Program Files \ CodeBlocks \ SDL \ lib.
When you are finished, you can delete the SDL file on the desktop. Next, enable CodeBlocks so it will be seen following the application window display

Code::Blocks open window
Code::Blocks open window

Then, select the Settings menu and then select the menu compiler and debugger, so you'll see a window like the following new applications

codeblocks compiler and debugger window
compiler and debugger Code::Blocks

In that window, select the Linker settings tab and click the Add button on the link libraries. Then you would get add libraries application window. Click Browse to select the location of the lib files that you have previous pairs. In our computer is in the address C: \ Program Files \ CodeBlocks \ SDL \ lib.

Code::Blocks add library
Code::Blocks add library application window

After successfully perform these steps, select the tab Search directories and on the Compiler tab click the add button to open the windows add directory. Click Browse to select the folder location that you include the previous pairs in the computer. In our computer is in the address C: \ Program Files \ CodeBlocks \ SDL \ include

Code::Blocks add directory
Code::Blocks add directory application window

Make sure you have successfully done that step. If you are lost with this step please write in our comments field so we can respond. The next step is to re-create a new folder inside the folder CodeBlocks you have installed on your computer with the project name. Put the file SDL.dll in the folder project. We suggest to you that in making the project CodeBlocks, save the project location is inside this folder. This is the easiest of the many ways we've tried before and most secure in consuming memory size.



Now it's time to open a new SDL project. How, select the menu File-> Menu-> Project. After that, you will be confronted with the application window New From Template.

new from template application window
New From Template application window

In the category of the window menu select Project. Then select the SDL Project. So that you will see the following application window

SDL Project
SDL Project

After you select the Next button and you will see the following application window

SDL project title
SDL Project Title

In this application window write the title of the SDL project are you going to make. In the field of Folder to create projects in: select a project folder location which you have previously made in CodeBlocks folder. After that, click the Next button to open new application window as follow

SDL location
SDL location

Then select the location of the SDL file which you have put in your computer. On our computers SDL address is C: Program Files \ CodeBlocks \ SDL , and then click the Next button to open the following application window


SDL compiler
SDL compiler

In that window, choose the compiler with GNU GCC Compiler. Now, click the Finish button to open your project then immediately you will see the following script c++

Opening SDL Project
Before running the program please put SDL.dll in the project folder name you have created. In this example, we create a project folder named try so we put SDL.dll in this folder with the address C: \ Program Files \ CodeBlocks \ projects \ try. You just push F9 on your computer to run this project, so that you will see the following picture
SDL application
SDL application



If the result of your project show this picture it's mean you are success to install SDL in your Code::Blocks.
If you are not success you can ask us.


External links

Post a Comment