Wiki How-to Request: Eclipse Ide Setup


hitbyambulance

Active Member
Joined
Nov 26, 2005
Messages
636
Location
Seattle, WA
Website
troubletype.org
i would like to see someone add to the GP2X wiki a how-to on setting up Eclipse as a GP2X IDE. actually, any information at all would be appreciated... even if it's just writing a makefile.
 
I second that!

The lack of features (good debugger, pane-splitting, code collapse) in Dev-C++ is making me nuts!
 
Eclipse and cross development without using closed-source plugins such as WindRiver's Workbench or Montavista's DevRocket is not great to work with. However I do use Eclipse (under linux) to develop for the gp2x. Here are some steps you might wanna follow:

1. First install Eclipse and CDT plugin
I've put Eclipse in /usr/local/eclipse

2. Obtain a gp2x toolchain
I've put the toolchain (build from scratch using Oopo's devkit http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,14,1609) in /usr/local/gp2xdev

3. Compile all necessary libraries (SDL etc)
I'm using the libs included within Oopo's devkit at the moment and put them in the same prefix as where the toolchain recides.

4. Create a new Managed Make C / C++ project within a workspace
i chose /home/username/workspace for the workspace. Managed build so you don't have to worry about writing makefiles.

5. Write some program and create one or more build configs :)
Currently I'm only working on some SDL stuff and, because of the platform transparency, i created two build configurations. The first one to native build the project and the second one to cross build the project. These two configurations mainly differ in the following:

Code:
						   Native Build				 Cross Build

GCC Compiler Command	   g++						  /usr/local/gp2xdev/gp2x/bin/g++
Include paths (-I)		 - (assuming you installed	/usr/local/gp2xdev/include
						   SDL e.a. using the package   /usr/local/gp2xdev/gp2x/include
						   manager)
GCC Linker Command		 g++						  /usr/local/gp2xdev/gp2x/bin/g++
Library search path (-L)   - (see above)				/usr/local/gp2xdev/lib
														/usr/local/gp2xdev/gp2x/lib
(You should obviously replace g++ with gcc if you're using C instead of C++)

Furthermore you may want to statically link when cross building. Then you must add "-static" to the linker options. This also has impact on the libraries to link with; linker errors should tell you enough about what libraries you should link with (note that the order of linking is also important). Last but not least I defined a variable for the Cross Build (-DTARGET_GP2X) so that you can use a preprocessor macro to distinguish between cross and native build.

Like this I think Cross building with just Eclipse and the CDT is doable. Let me know if something is not clear.
 
Back
Top