gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Setting up Code::Blocks for DS development

#161919 - The_Perfection - Mon Aug 18, 2008 9:13 pm

I recently looked into using Code::Blocks for development and found it very nice for PC programs, but haven't managed to get it to build projects with devkitPro. I've tried changing the compiler path and setting it up with a custom makefile, but I haven't gotten it to work yet. How do I set this up?

#161922 - silent_code - Mon Aug 18, 2008 9:29 pm

Easiest thing in the world!

I'll give you a step by step rundown - ignoring anything you might have done already:
    - First set up C::B, gcc, gdb etc. and compile a simple example (dafault project) to verify everything works fine.
    - Install devkitPro; a regular installation with everything you'll need
    - Compile an example to verify the installation (via make in the windows shell [run cmd])

Ok, now on to the "fusion" part:
    - Open C::B's compiler settings
    - Select the GNU GCC Compiler preset
    - Make a copy of it, rename it to something along the lines of "NDS GCC"
    - Change to the toolchain executables tab
    - Select your devkitARM installation folder via (...)
    - All tools should be found, except the resource compiler, which is not needed. The tools' names start with arm-eabi-

You're nearly done:
    - Select make from msys' bin folder.

Next you need to make a new project or open an exsisting one and:
    - Go to Project->Properties...
    - Select only Windows as the target platform (may not be required, though)
    - Enter the makefile's name and check the custom makefile box (to be checked!)
    - In the build options, you need to select the NDS compiler setting you created earlier
    - Also in the build options, you will have to modify the make commands in the last tab: remove $target at the end of the first (build) and the third (clean) line

Now you should be able to hit compile and rebuild without any problems.


Optional stuff:

You can't just hit "run." Well you can, but it won't run the rom. That's why I include the .nds files in the project tree. When you double click it (and it already exists), C::B asks you how to open it. On Windows you can select to open it with the associated application (e.g. no$gba).

You can also include some search directories in the compiler settings. I recommend including libnds' and some devkitARM include folders.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.