Skip to content

Setup SGDK with Eclipse

cyguard2 edited this page Jan 6, 2024 · 19 revisions

Setup Eclipse

  1. Define "GDK" environment variable to your installation path in unix path format (example D:/apps/sgdk).
  2. Download Eclipse CDT at http://www.eclipse.org/cdt/downloads.php and install it wherever you want.
  3. Launch Eclipse and set your workspace folder (will be your root folder for your futures projects).
  4. Go to the workbench and select menu Window > Preferences to setup Eclipse
  5. In General > Workspace
    • check Save automatically before build
    • uncheck Build automatically
  6. In C/C++ > New CDT Project Wizard > Makefile Project go to the Builder Settings tab
    • uncheck Use default build command
    • set Build command value to ${GDK}/bin/make
    • go to the Behavior tab
    • check Use custom build arguments
    • set Build Arguments value to -f ${GDK}/makefile.gen
  7. In C/C++ > New CDT Project Wizard > Makefile Project go to the Behavior tab
    • check Build (incremental build)
    • replace field value all by ${ConfigName} so it will use the current active configuration to build the project
    • check Clean
    • replace field value clean by clean${ConfigName} so it will use custom clean depending the current active configuration

Setup Project

  1. You can now create a new project (File > New > C Project > Makefile project > Empty Project > --Other toolchain--).
  2. Right-click on the project and select Build configurations > Manage...
    • Rename the Default configuration to Release
    • Add a new configuration named Debug
    • So now you can change the active configuration depending the build you need :)
  3. Right-click on on the project and select Properties to setup the project itself.
  4. In C/C++ General > Paths and Symbols, add a new directory in Includes tab
    • Directory: ${GDK}/inc
    • Check Add to all configurations
    • Check Add to all languages
    • Validate by clicking OK
  5. Click Apply and rebuild the index if it asks for it and you're ready to compile your project :)

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.
  • Be sure to uncheck the Project > Build automatically option.