Configuring Eclipse for Wii development

Eclipse logo

This tutorial is intended for intermediate users that are not new in homebrew,  so it will not be plenty of screenshots and assumes that devkitPro is already installed and its variables set.

This guide can also be applied for NDS and maybe other platforms supported by  devkitPro (not tested), just change the path where libraries are installed when needed.

It can also be used on Windows too (not tested too, but there should be no differences other than changing paths).

Last note: I used Eclipse few times in my life, so probably there are other (and smarter) ways to achieve the goal, but this tutorial was written mainly for myself, since I was not satisfied of current editors/IDEs I’ve tried on Linux for homebrewing.

Suggestions are welcome!

Before starting

I’m assuming that:

  • devkitPro is already installed in /opt/devkitpro with permission changed for the destination user
  • Eclipse will be installed in /opt/eclipse

Also for my needs I want to code  an existing SVN project I’m working on: coverfloader.

Eclipse

If you already have Eclipse installed without C++ support, you should download the CDT plugin from Help | Install new software and then select a site (Galilelo is the one of the current release).

Search and install CDT plugin, then reboot Eclipse as suggested.

I didn’t like the default Eclipse (3.2) shipped with Ubuntu so I prefered to grab the latest stable one with C++ support  already in (Eclipse IDE for C/C++ Developers).

Installing Eclipse is very straightforward, just unpack it and execute it. As I said I put the contents of the directory /opt/eclipse/ one.

At first boot you’ll be welcomed with a screen asking you to select a directory for storing the workspace (where all your project will be saved): default choice was fine for me.

Installing SVN plugin

Next step is installing SVN plugin: we will use subversive, a plugin that can be installed directly from Eclipse.

Go to Help | Install new software and then select a site (Galileo again).

Expand the Collaboration category and select Subversive SVN Team Provider (Incubation), then click Next and follow instructions (reboot is required).

Subversive also need a connector to be installed so open the install software window again, then click the Add button and paste this site: http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/

Expand the Subversive SVN Connector catergory, and then install SVNKit 1.3.0 Implementation, click Next and follow instructions (guess, what? Reboot!)

Last step is to check that the SVN connector is correctly installed: go to Window | Preferences, expand the Team tree and click on SVN.
Select the SVN Connector tab and check that  SVN connector is SVN Kit. If not, try to install other connectors (I didn’t have problems though).

Eclipse is now ready configured for using SVN… easy uh?

Let’s create our first project doing a checkout from svn server!

Checking out the project from a SVN site…

Go to File | New | Other and then expand the SVN tree, then select Project from SVN, click Next.

Add the url, in my case https://wiicoverflow.googlecode.com/svn/trunk, fill username and password fields if you have any, click No to normalize url question (at least for my needs), and accept the site’s security certificate.

There is a little bug at this step: you can’t click the Finish button even if an option is selected. For fix this just click again to the default option selected (Head Revision), click Finish.

A new window will pop up, use the default option Check out as a project configured using the New Project Wizard, then click Finish to open a Wizard.

Expand the C/C++ tree and then click to C++ Project, Next, choose a name for your project, then expand Makefile project tree, select Empty Project, click Next.

Click on the Advanced settings, expand  C/C++ Build tree, then select the Behaviour tab, remove the “all” word from Build (incremental build).

Click Ok, then on Finish so that Eclipse can check out the project.

…or create a new Wii project

The easiest way to copy the template (shipped with the Wii examples package from devkitPro site) in the workspace directory removing the unused file template.pnproj (used by Programmer’s Notpad).

Go to File | New | C++ Project and then browse for the location where you copied the template directory. If you copied it to the workspace one just type the name of  the project, since the workspace directory is default.

Expand the Makefile Project, select Empty Project and click Next.

Click on the Advanced settings, expand  C/C++ Build tree, then select the Behaviour tab, remove the “all” word from Build (incremental build).

Click  Ok, then on Finish so that Eclipse can check out the project.

Configure paths:

Go to Project | Properties, expand the C/C++ General tree, then select Paths and Symbols. On the include tab click to Add and add the following paths (checking Add to all configurations and Add to all languages each time):

  • ${DEVKITPRO}/libogc/include
  • ${DEVKITPPC}/lib/gcc/powerpc-gekko/4.2.4/include
  • ${DEVKITPPC}/powerpc-gekko/include
  • ${DEVKITPPC}/powerpc-gekko/include/c++/4.2.4
  • ${DEVKITPPC}/powerpc-gekko/include/c++/4.2.4/powerpc-gekko

Press Apply and answer yes to rebuild the index, then press Ok.

Now auto complete will work for both functions and structs (pressing CTRL+SPACE).

Build our project

We need at least 3 make targets:

  1. clean
  2. build
  3. send dol through wifi using wiiload (optional)

Let’s create them. Click somewhere in the code (or in the makefile), then Make Target -> Create, then click Add button:

  1. Target name: clean, click Ok.
  2. Target name: build, uncheck Same as the target name and remove the make target field, click Ok.
  3. Target name: run, uncheck Same as the target name and type run in the make target field, click Ok.

For build the project, click on the Make Target tab on the right side of Eclipse, then double click on the make target you wish to execute.

Start coding!

Eclipse IDE

As you have seen, it is not difficult to configure Eclipse for Wii coding, just configure some path and install some plugin, now it’s all up to you!

Since I’m not an experienced Eclipse user, all suggestion are welcome for improving this guide🙂

9 pensieri su “Configuring Eclipse for Wii development

  1. Nice tutorial! I was wondering why you need the svn? I followed the steps but I get “Invalid project path: Include path not found(” and all the includes I just added… It seems like it can’t find the ${DEVKITPRO} part. Where should you set it?

    Mi piace

Lascia un commento

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...