In this tutorial, we intend to explain how to install sdl_gfx in CodeBlocks. SDL_gfx is one of the library outside libsdl, sdl_gfx can be used to rotate an image and or enlarge the image. With this library we have, we will be able to rotate an image with just one simple command.
Now, open http://www.ferzkopp.net/joomla/content/view/19/14/ site, this site is the main source of sdl_gfx. Then select the topic Downloads. When we write to you, the latest version of sdl_gfx is SDL_gfx-2.0.22, maybe when you read this tutorial sdl_gfx has released a newer version again. Please download the latest version sdl_gfx (SDL_gfx-2.0.22.tar.gz as we write this tutorial)
Once successfully downloaded, we recommend you extract the entire contents of compresses sdl_gfx on your own desktop computer. The goal, after successfully installing sdl_gfx, you can easily remove the extract of sdl_gfx from your computer.
You would be surprised to see the contents of sdl_gfx extract, because you are not see SDL_gfx.dll and libsdl_gfx. This is very different from the previous tutorial (we suggest you to read our previous tutorial on How To Install SDL In CodeBlocks). The expected outcome of this tutorial is to get those files.
Ok, now run the software CodeBlocks. Click File -> Import project -> MS Visual Studio project ..., we must do this because sdl_gfx extract did not provide for CodeBlocks project. Fortunately, CodeBlocks can read a project from MS Visual Studio.
Next, select the folder sdl_gfx extract, you'd have put it extracts a folder on the desktop, right? Select file SDL_gfx.vcproj. You will see a message box Compiler selection, select only the GNU GCC Compiler, click ok. Then you will also be asked to select a configuration to import. Just select the Debug Win32 and Release Win32. Then the project from visual studio is open
The next step, click F9 or Build -> Build and Run to execute the project. Wait, then you will see the following message box
If this message box appears, then you have successfully installed sdl_gfx in CodeBlocks. If it turns out you do not succeed (this is the development of previous tutorial), click Settings -> Compiler and debugger
Select the tab of Search Directiories, and on the Linker tab you should write down the address of SDL lib on your computer, see the example
Next, copy all the header files from the folder sdl_gfx extract, into the folder of SDL include (please re-read our previous tutorial). Then copy the file SDL_gfx.dll, into the project folder of SDL folder (please re-read our previous tutorial). After that, copy the files libSDL_gfx.dll.a and libSDL_gfx.dll.def (option), into the lib folder of SDL folder (please re-read our previous tutorial).
Furthermore, in the software CodeBlocks, reopen the compiler and debugger, select of Linker Settings tab, and in the link libraries click the Add button, then open the lib folder of SDL folder, select the file libSDL_gfx.dll.a, then click ok. Done, you've just successfully installed a sdl_gfx in CodeBlocks. To be more details, please see our tutorial video in youtube.
thanks alot for sharing!
ReplyDeletebtw, thanks for comment to my blog dhiibhiehh . . I will follow your tweet n your site . .
thanks before :)
Ok, you r welcome
ReplyDeleteThanks for this, very useful !
ReplyDelete