Tutorials:CodeBlocks

Easy process to creating GCW-Zero applications using CodeBlocks
Creating applications with CodeBlocks is rather easy. You can create a whole game using the Windows or MAC version of the IDE and then simply load it up via the Linux version of CodeBlocks and build for the GCW-Zero. There is just a few things you need to do in order to do this first:


 * Make sure you did not use any Windows only libraries or engines.


 * Verify that the libraries you want to use are provided by OpenDingux.

Adding the GCW-Zero ToolChain to CodeBlocks
Download the latest toolchain for the GCW-Zero here: [| http://www.gcw-zero.com/develop.php].

Then open CodeBlocks, and in the Settings menu, select Compiler and debugger.... Please note that some versions of CodeBlocks have the Compiler and Debugger options in different menus.
 * In the Selected compiler section, select GNU GCC Compiler and click copy. You will be asked to name the new toolchain; name it, for instance, 'GCW Zero Compiler'


 * In the Toolchain executables tab, change the Compiler's installation directory to /opt/gcw0-toolchain/usr


 * Change the names of the Program Files to reflect the names used on the toolchain: mipsel-linux-gcc, mipsel-linux-g++ and mipsel-linux-ar. Do not change the name of the 'Make program'.

Here is how it should look:



Using SDL
If your project uses the SDL library, you have to tell Code::Blocks where to find its headers and which libraries to link to:
 * In the Project menu, select Build Options...


 * In the tree view on the left hand side of the dialog, select the top-level node (the one representing your project), such that the settings you change apply to all targets (Debug, Release etc)


 * In the Search directories tab, select the Compiler subtab and click the Add button. Enter the path /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/SDL


 * In the Linker settings tab, click the Add button and enter SDL as the library file name


 * In the same way, you can add more libraries you plan to use, for example SDL_image, SDL_mixer or SDL_ttf