<!-- This page is a WIP
Please leave suggestions on the talk page instead of editing directly, for now.
The [http://www.eclipse.org/ Eclipse Platform] is a modern open source IDE with a built-in debugger GUI and support for several programming languages via plug-ins. Plug-ins can also be used to extend functionality. For many,
programmer's notepad and insight will suffice, but others may find the combination a little out of date. This wiki will guide you through each stage in the setup process, but assumes that you are using Windows, have already installed [[devkitPro]] (including devkitPPC) and are relatively familiar with the concepts of developing Wii Homebrew. I hope it is of use to others ~ [[User:PhoenixTank|PhoenixTank]] | [[User talk:PhoenixTank|talk]] | [[Special:Contributions/PhoenixTank|contribs]] |
== Requirements ==
* [http://www.java.com/en/download/manual.jsp JRE (Java Runtime Environment)] installed.
* A copy of ''Eclipse IDE for C/C++ Developers'' [http://www.eclipse.org/downloads/] '''Current Version:''' eclipse-cpp-ganymede-SR2-win32.zip
*You now see the main IDE with Project Explorer, File Editor, Console and others panes.
*There will be an error and a probably warning in the problems pane. Don't worry about them for now, and open C:\devkitPro\examples\wii\template\ in Windows Explorer. Select the Source folder and makefile, and copy them to clipboard. Return to Eclipse, right click the HelloWorld project in Project Explorer, and paste. The files should now be a part of your project.
*Head to Projects > Properties, or do the same from the right click menu of HelloWorld. Click
''C/C++ Build '' then choose the ''behaviour '' tab. Here, change the value of ''Build (Incremental Build) '' to ''build '' or simply blank, then hit OK. Alternatively, use a [[#Custom Make Targets|custom make target]] instead of the built in build.
*With default settings, Eclipse will immediately build your project. The error should no longer be there to pester you.
*If you have a warning like: Error launching external scanner info generator (gcc -E -P -v -dD C:/WiiDev/projects/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp) then the easiest way to fix this is to add C:\devkitPro\devkitPPC\powerpc-gekko\bin; to the start of your [[#Path|path]] environment variable.
Eclipse is quite customisable, but the large amount of settings can be a struggle to wade through, in order to find what you are looking for.
I have some personal preferences that may be of interest to others.
From Window > Preferences:
*General ¬ Workspace.
''Build automatically '' unchecked, ''Save automatically before build '' checked.
*C/C++ ¬ Code Style. I use BSD/Allman, but the other most common styles are there too.
*C/C++ ¬ Editor ¬ Content Assist. Drop the delay to 200 ms.
<!--*C/C++ ¬ New CDT project wizard ¬ Makefile Project : Behaviour tab. Uncheck ''Build on resource save'' , change value of ''Build (Incremental Build)'' to ''build''--->
== Debugging ==
'''*****This section is still being worked on, and is incomplete.*****'''
The Eclipse CDT has a nice integrated debugging GUI (which is half of the reason for this tutorial), but unfortunately does not support remote C/C++ applications "out of the box". To get around this Eclipse needs to be extended, and we are lucky enough to have a plug-in available to us. [http://opensource.zylin.com/embeddedcdt.html]
*Name it HelloWorld GDB or other relevant name, but bear in mind that it will need to be unique across all Eclipse projects.
From here, I'll explain settings tab by tab, as there are several ways to achieve the same setup.
==== Main tab ====
*Adding your project name is optional, and may or may not be filled in for you already. It only seem to enable the Search Project button below, which doesn't actually do anything useful for us.
==== Debugger tab ====
*GDB debugger - enter the path "C:\devkitPro\devkitPPC\bin\powerpc-gekko-gdb.exe". '''This
one is required.'''
*GDB command file - As an alternative to the commands tab, you can specify an external file containing GDB commands to run. Blank the field if you aren't going to use it. This may be useful if, for example, your Wii can't be assigned a static IP. Using a single command file that is updated to target the new Wii IP is easier than editing the config in each project.
*Protocol - Keep it as "mi". I haven't tested for any differences yet.
==== Wifi Debugging Patch ====
AKA "The poor man's USB Gecko". This takes a little work to implement, but at a total cost of £0, who can complain?
You'll need to be familiar with checking out from a SVN, patching source files, and compiling libogc from source.
===== Setting up the patch =====
*Check out libogc SVN
*Apply tcpipwifi.patch from: http://sourceforge.net/tracker/?func=detail&aid=2707076&group_id=114505&atid=668553
*Compile libogc and install.
===== Example GDB target command =====
target remote 192.168.0.5:8000
== Credits ==