-
-
Notifications
You must be signed in to change notification settings - Fork 189
Setup SGDK with Eclipse
#summary Setup SGDK with Eclipse CDT
Here's how to use the devkit with Eclipse CDT IDE
== Setup your files == Download Eclipse CDT at http://www.eclipse.org/cdt/downloads.php
- Create a directory for Genesis development only, without space or special chars
- Unzip EclipseCDT and SGDK there
- Rename SGDK's one as "sdk"
- Create an other directory called "projects".
In the end, you have {{{ ->eclipse folder ->sdk folder ->projects folder }}}
== Setup Eclipse ==
Launch Eclipse and type ../../projects as workspace folder {{{ each new project will be added to this folder by Eclipse }}}
Go to the workbench and select menu Window > Preferences to setup Eclipse
In General > Workspace, select Save automatically before build and unselect Build automatically
In C/C++ > Build > Build Variables, add a new variable :
- Variable name : GDK
- Type : Directory
- Value : ../../sdk
{{{ this will define $GDK needed by sdk/makefile.gen }}}
http://sgdk.googlecode.com/svn/wiki/pictures/eclipse01.png
In C/C++ > Build > Environnement, add a new variable
- Name : GDK
- Value : ../../sdk
{{{ this will define a var used on Eclipse IDE }}}
http://sgdk.googlecode.com/svn/wiki/pictures/eclipse02.png
In C/C++ > New CDT Project Wizard > Makefile Project
- unselect Use default build command in Builder Settings tab
- set, as Build command,
${GDK}/bin/make -f ${GDK}/makefile.gen
{{{ this will define sdk/makefile.gen as the default makefile of any project }}}
http://sgdk.googlecode.com/svn/wiki/pictures/eclipse03.png
== Setup Project == You could now create a new project (File > New > C Project > Makefile project > Empty Project > --Other toolchain--).
http://sgdk.googlecode.com/svn/wiki/pictures/eclipse04.png
Right-click on it and select Properties to setup the project itself.
In C/C++ General > Paths and Symbols, add a new directory in Includes tab
- Directory :
${GDK}/include
- Add to all configurations
- Add to all languages
http://sgdk.googlecode.com/svn/wiki/pictures/eclipse05.png
Click Apply and rebuild the index
http://sgdk.googlecode.com/svn/wiki/pictures/eclipse06.jpg {{{ this will make available the headers on /sdk/include to your project }}}
On Make Target view, create a new target for your project.
- give it a name
- unselect Same as the target name
- empty Make target field http://sgdk.googlecode.com/svn/wiki/pictures/eclipse07.png {{{ double click on this target to generate a out/rom.bin according your project's file, sdk/makefile.gen and sgdk library }}}
== Common error ==
If you have an error on build like main() not found
, be sure to click Apply on project properties's C/C++ General > Paths and Symbols.
Another source of problem : be sure to un-mark Project>Build automatically