Difference between revisions of "User:PhoenixTank/Setting up Eclipse for Wii Development"

From WiiBrew
Jump to navigation Jump to search
(First stage of setting up Eclipse.)
 
Line 1: Line 1:
 
<!-- This page is a WIP
 
<!-- This page is a WIP
Please leave suggestions on the talk page instead of editing, for now.
+
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 it 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]] and are relatively familiar with the concepts of developing Wii Homebrew.
 
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 it 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]] and are relatively familiar with the concepts of developing Wii Homebrew.
Line 18: Line 18:
 
*There will be an error and a warning in the problems pane. Don't worry about them for now, and open C:\devkitPro\examples\wii\template\source 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.
 
*There will be an error and a warning in the problems pane. Don't worry about them for now, and open C:\devkitPro\examples\wii\template\source 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''. Expand C/C++ Build and then choose discovery options. Uncheck ''Automate discovery of paths and symbols'' and hit OK.
 
*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''. Expand C/C++ Build and then choose discovery options. Uncheck ''Automate discovery of paths and symbols'' and hit OK.
*With default settings, Eclipse will immediately build your project, but we will discuss these settings later. The error and warning should no longer be there to pester you.
+
*With default settings, Eclipse will immediately build your project, but we will discuss these settings in the next section. The error and warning should no longer be there to pester you.
 +
 
 +
== More Settings ==
 +
=== Enabling Autocomplete ===
 +
Unfortunately, Eclipse's automatic search for paths and symbols is bugged, and you had to disable it. Usually this would do the work of finding the files it needs to integrate functions into autocomplete, but we are going to have to do it manually.<br />
 +
Open your project's properties, head to C/C++ General, then Paths and Symbols. You then need to add the following paths, making sure to select "Add to all languages". Note that the folder names you need may vary, such as the 4.2.4 being higher or lower, and of course you need to correctly alter the paths to point to the location that you installed devkitPro to.
 +
 
 +
<!-- This section should probably be rewritten with use of environmental variables, DEVKITPRO and DEVKITPPC etc. -->
 +
<pre>
 +
C:\devkitPro\libogc\include\
 +
C:\devkitPro\devkitPPC\lib\gcc\powerpc-gekko\4.2.4\include\
 +
C:\devkitPro\devkitPPC\include\
 +
C:\devkitPro\devkitPPC\powerpc-gekko\include\
 +
C:\devkitPro\devkitPPC\powerpc-gekko\include\c++\4.2.4\
 +
C:\devkitPro\devkitPPC\powerpc-gekko\include\c++\4.2.4\powerpc-gekko\
 +
</pre>
 +
If you have subfolders within your project that contain source files, you may also need to add a path to your source folder.
 +
 
 +
<!--
 +
=== Changing Defaults ===
 +
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.
 +
-->

Revision as of 16:13, 26 May 2009

The 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 it 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 and are relatively familiar with the concepts of developing Wii Homebrew.

Requirements

Getting Started

  • Extract the eclipse zip to a directory of your choice. I recommend C:\eclipse\ N.B. There is no installer. Create yourself a shortcut to C:\eclipse\eclipse.exe, for convenience.
  • Fire up Eclipse, and if all goes to plan you should be greeted with a box asking you to select a workspace. Pick wherever you like, but for the sake of this guide, we will choose C:\WiiDev\projects\. You should choose to make this the default if you aren't interested in using Eclipse for any other development projects.
  • You are greeted with the Welcome splash screen. There are some tutorials on using Eclipse, but leave them for now. Head to File > New > C++ project (Or C Project, if you prefer, but this guide will reference C++ primarily)
  • In the dialogue box, name your project "HelloWorld" and chose Makefile ¬ Empty Project, then hit Finish.
  • Head to the workbench by clicking the far right arrow icon.
  • You now see the main IDE with Project Explorer, File Editor, Console and others panes.
  • There will be an error and a warning in the problems pane. Don't worry about them for now, and open C:\devkitPro\examples\wii\template\source 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. Expand C/C++ Build and then choose discovery options. Uncheck Automate discovery of paths and symbols and hit OK.
  • With default settings, Eclipse will immediately build your project, but we will discuss these settings in the next section. The error and warning should no longer be there to pester you.

More Settings

Enabling Autocomplete

Unfortunately, Eclipse's automatic search for paths and symbols is bugged, and you had to disable it. Usually this would do the work of finding the files it needs to integrate functions into autocomplete, but we are going to have to do it manually.
Open your project's properties, head to C/C++ General, then Paths and Symbols. You then need to add the following paths, making sure to select "Add to all languages". Note that the folder names you need may vary, such as the 4.2.4 being higher or lower, and of course you need to correctly alter the paths to point to the location that you installed devkitPro to.

C:\devkitPro\libogc\include\
C:\devkitPro\devkitPPC\lib\gcc\powerpc-gekko\4.2.4\include\
C:\devkitPro\devkitPPC\include\
C:\devkitPro\devkitPPC\powerpc-gekko\include\
C:\devkitPro\devkitPPC\powerpc-gekko\include\c++\4.2.4\
C:\devkitPro\devkitPPC\powerpc-gekko\include\c++\4.2.4\powerpc-gekko\

If you have subfolders within your project that contain source files, you may also need to add a path to your source folder.