PurposeThis tutorial will help you get the SGDK compiler setup in a Code::Blocks environment.
Download Required FilesYou will need to download the required SGDK and CodeBlocks files. As of the writing of this tutorial, SGDK 1.11 and Code::Blocks 13.12 were the latest verions. Note that I used SGDK 1.01 in this tutorial...
SGDKDownload the latest SGDK here. You will need to extract the archive to your drive - I recommend "C:\Dev\SGDK" but this is an arbitrary choice; place it wherever you like.
Code::BlocksDownload the latest Code::Blocks here. Follow the installer instructions, if you can't do this then stop immediately and forget about dev'ing altogether.
Setup Environment VariablesYou'll need to setup two new environment variables under Windows in order to compile using SGDK: GDK and GDK_WIN.
![]()
Before (left) and after (right), make sure you entered the correct back-slash and forward-slash for these entries.
![]()
You also need to add SGDK's /bin directory to your System Path variable.
![]() Test by Building SGDK LibraryBefore moving on, we need to build the SGDK lib using the new environment variables. Every time you download a new version of SGDK you will need to rebuild the library. Also, since all of the library source files are included in %GDK_WIN%\src you can make modifications to the library code and re-build according to your needs.
%GDK_WIN%\bin\make -f %GDK_WIN%\makelib.genYou should see a whole bunch of stuff in the command line during library build, it'll take a few seconds to complete. If you were not successful, review the above steps and ensure your environment variables are setup properly.
![]() At this point you could theoretically start writing 'C' programs and compiling them using the command line. You can do this by running this command directly from your project directory: %GDK_WIN%\bin\make -f %GDK_WIN%\makefile.genThis should output a rom.bin file in the \out directory of your project. Setup Code::BlocksWriting code in a real IDE is much better than writing your programs in Notepad++ (unless that's what floats your boat). You should have Code::Blocks 13.12 installed before proceeding. New Compiler ConfigurationWe'll need to configure SGDK as a new compiler in Code::Blocks.
![]()
![]() That's it, Code::Blocks is configured to compile using SGDK! |









