Learn More

Contributors

Sunday, July 31, 2011

How To Install SDL_image In Codeblocks

sdl logo
Hello, long time we did not post materials on the tutorial create 2-dimensional games. Now we will proceed with installing SDL_image posting in CodeBlocks. We do this because in a previous post still discussing load bmp extension image. Apart from that, we will not be able to load images for our game. Of course we do not want this to happen.

To be able to load the images instead of bmp, we have to put SDL_image in CodeBlocks program we've previously installed. For that, please access http://www.libsdl.org/projects/SDL_image. Then in the Binary, select SDL_image-devel-1.2.10-VC.zip, in this way then SDL_image will be downloaded into your computer.

Once completed, please extract the file of SDL_image on your computer. Before we discuss further, please read our post about how to install sdl in CodeBlocks, so you can understand the steps we did. Copy files from SDL_image.h in include folder of the SDL files that you extract. Then, paste the file in include folder which already existed in the folder CodeBlocks. As for the file SDL_image.lib (SDL is in the folder that you extract) did you do in a similar way, but you should put the file in the lib folder which already existed in the folder CodeBlocks.


Of course, you will see another files in lib folder that you extract. There are files of dynamic library (*.dll). All of these files must put in project folder which already existed in the folder Codeblocks. Then, open Codeblocks and click Settings -> Compiler and debugger menu. So that you will see Global compiler settings application window. 

global compiler settings sdl


Click Linker settings tab and then you will see Add library application window. Select the folder containing the files SDL_image.lib, and for next step is same when you Setting SDL in Codeblocks.

In the Add Library window, click Browse, we remind you again, SDL_image.lib make sure you've put in the lib folder of the folder CodeBlocks. After getting SDL_image.lib then click ok. SDL_image.lib then there will be on the list of linker settings. After that click ok on global compiler settings. While SDL_image.dll files you put on the project folder. To ensure what you done is working, see the video from us, you can put another file of png (portable network graphics). In this movie we using windows 7, but basicly it same.

Post a Comment