GP2X Setting Up Environment


0-bake

Active Member
Joined
Dec 15, 2003
Messages
538
hi,

i just treid to set up an environment for developing for the GP2X. i used the instruction in Guyfawkes manual.
the problem now is, i can't 'make', because i have no executable file called 'make.exe' an my system.

edit: ahh i just installed the msys 1.0 and set path to the msys\bin.
successfully compiled the demo :)


but i would also like to compile a .exe for testing in windows.
the wiki is referring to http://mingw.org/download.shtml
but there are dozens of files. i don't know wich exactly to download and then how to configure them.
is there any tutorial/instructions?
 
so, i tried a lot of stuff today, but there are still problems and questions:

as i wrote above, the compiling via typing 'make' in the commando-window in windows works for the demo.rar and for other small examples i tried as well (using the same makefile) .)

but i like set up an IDE. i tried Dev-CPP (the file with GCC and msys), but it could only compile the self-included examples, not the example from the demo.rar (i also added path to the \devkit\include\sdl in dev-cpp)
so i'm not sure what to to.

i would like to have an IDE, which lets me decide to compile a .gpe or a .exe file.
but i'm not sure how i have to configure dev-cpp.
i also noticed that the directory settings in dev-cpp doesn't recognize subfolders, wich makes it very complicated to include big trees.

has anyone managed to build such a system? is it even possible? for what i've read, it's basically the meaning of SDL to compile it for different systems. so i guess, there must be a way.
 
Well, it's certainly possible (easy in fact) to set up WinterMutes DevKitGP2X as an extra compiler profile under Dev-Cpp... but I take it you are using a different set of tools?

But this information should remain the same...

Go to the menu item Tools -> Compiler options

It says "Default compiler" in the drop down menu on the first tab. Click the "add" button and name it something suitable. This sets up a new compiler profile. Now go to "directories" tab. There are several sub-tabs (binaries, libraries, C includes, C++ includes). Go to each one, look at which directories are listed there, and replace them with the versions that you have (in order to include the things that are for targeting the ARM and Linux combo of GP2X rather than the standard ones.

Finally, go to the "programs" tab, look what's entered into the boxes, and replace them all with your equivalents.

It worked for me, though ATM I still have to manually rename the files from*.exe to *.gpe. I'm assuming that it's worked becasue it errors when run on my computer (since it's Windows under AMD, which I believe is x86 architecture?)

Once that's done, you can swap freely between the two compiler profiles, default for compiling for your PC, and your GP2X one for compiling for (you guessed it) gp2x!

Good luck :)

EDIT: Just took a look at the instructions in GuyFawkes' guide, and realised that it does in fact tell you to use DevKitGP2X, so I was wrong in my original assumption ;)
 
thanks for the reply :)

i tried exactly that (and i'm using devkitgp2x) but there are several problems.
i guess, the dev-cpp can't read the makefile.

second question is, i don't know exactly where to set the paths in the IDE compiler settings.
some program files lying around in
\devkitgp2x\arm-linux\bin
but the make.exe is in
\devkitgp2x\msys\bin

yesterday i installed the dev-cpp with mingw and gcc to have a already setup environment, but i couldn't compile sdl sources with that, because i didn't make it to set all the include paths. these (.h) files are everywhere and the dev-cpp doesn't accept supfolders :(
so i started adding:
\devkitgp2x\include
\devkitkp2x\include\sdl
\devkitgp2x\include\c++\4.02\arm-linux\backward
and so on. but after chosing "compile' always files where missing, i even had to include
\devkitgp2x\sysroot\usr\include
but then i realized that there are dozens of directories and it can't be the goal to add all these to the settings.


the problem must be somewhere in getting dev-cpp to accept the makefiles, but i absolutely don't know how.

but even after a new installation of dev-cpp, i set the compiler directory to \devkitgp2x\arm-linux\bin (and make.exe manually to \devkitgp2x\msys\bin), set include directory to \devkitgp2x\include and library directory to \devkitgp2x\lib

i opened the demo.c and pressed 'compile'.
dev-cpp said "done", but nothing happened. the compiler log says:
Compiler: GP2X
Executing gcc.exe...
gcc.exe "C:\temp\demo\demo.c" -o "C:\temp\demo\demo.exe" -I"C:\devkitGP2X\include" -L"C:\devkitGP2X\lib"
gcc.exe: installation problem, cannot exec `cc1': No such file or directory

Execution terminated
Compilation successful
but as i said, no file was compiled.

and the not found cc1.exe is in \devkitgp2x\libexec\gcc\arm-linux\4.0.2\
so where do i have to set the path for this one?

isn't there an equivalent to 'make' in the dev-cpp commands?
as i said, if i go to the directory and type 'make' the .gpe compiles successfully.

i'm somehow stuck and have absolutely no idea what to do :(
 
0-bake posted on Dec 4 2005 at 03:02 PM said:
second question is, i don't know exactly where to set the paths in the IDE compiler settings.
some program files lying around in
\devkitgp2x\arm-linux\bin
but the make.exe is in
\devkitgp2x\msys\bin
Compiler path should be devkitgp2x\bin, not \devkit\arm-linux\bin. You should point to arm-linux-gcc if you're using C or arm-linux-g++ if you're using C++. I don't have MinSys installed now, but your make.exe path looks right.

0-bake posted on Dec 4 2005 at 03:02 PM said:
yesterday i installed the dev-cpp with mingw and gcc to have a already setup environment, but i couldn't compile sdl sources with that, because i didn't make it to set all the include paths. these (.h) files are everywhere and the dev-cpp doesn't accept supfolders :(
Look at Guyfawkes' Makefile. That is enough. Should be something like this:
Code:
CFLAGS = `$(SDL_BASE)sdl-config --cflags` -O2 -Wall
CXXFLAGS = `$(SDL_BASE)sdl-config --cflags` -Wall
I think "$(SDL_BASE)sdl-config --cflags" sets the correct path to SDL. And same for LIBS.

0-bake posted on Dec 4 2005 at 03:02 PM said:
i opened the demo.c and pressed 'compile'.
Remember you have to tell Dev-C++ to build your app with the new compiler setup (take a look at project settings).
 
Last edited by a moderator:
i found the option in the prject settings "use custom makefile"
when i chose this option and link to the makefile from the demo.rar, the project compiles the demo.gpe (doesn't matter, if the compiler path is set to \devkitgp2x\bin or \devkitgp2x\arm-linux\bin)

but the main question is not solved: how can i compile a .exe file, so that i can test the program without a GP2X handheld?

do i need a makefile for compiling .gpe's and one for compiling .exe's?
 
0-bake posted on Dec 4 2005 at 06:53 PM said:
but the main question is not solved: how can i compile a .exe file, so that i can test the program without a GP2X handheld?

do i need a makefile for compiling .gpe's and one for compiling .exe's?
If you want to test it on your system, you need to tell Makefile where the compiler, header files and libs for that system are. That means that it doesn't have to point to arm-linux-gcc/arm-linux-g++ but to gcc and g++ (wherever they are on your system), and the same for includes and libs: don't use GP2X ones, but your system ones (inside Dev-C++ folder?).

So the answer to the 2nd question is "yes", unless some Makefile rules I don't know about let you do it in just one file. In your case, I would have 2 separate ones.
 
Last edited by a moderator:
Hi didnt want to make a new thread as its relevent to this query.

Ive got DevkitGP2X up and running and have successfully compiled and got the demo working on my GP2X. Im started going through a few tutorials on SDL and downloaded some example code, simple things like "hello world" work fine with the provided makefile.

What I now trying to do however is port some more advanced SDL graphical demos over to the GP2X, I downloaded all the source code including the makefile that comes with it.

What I want to know is, what do I need to change in the makefile in order for this code to compile using Programmers Notepad, I have tried using the GuyFawkes makefile however I just get errors.

Thanks
 
hm, afaik programmer's notepad is just a text-editor and you can configure it to just give a 'make' command.
so it has nothing to to with the makefile.

btw, can you also compile .exe's for windows?
 
0-bake posted on Dec 7 2005 at 11:45 AM said:
hm, afaik programmer's notepad is just a text-editor and you can configure it to just give a 'make' command.
so it has nothing to to with the makefile.

btw, can you also compile .exe's for windows?

I havent attempted to compile it for windows yet, Ive only spent a couple of hours on this so far.
 
Last edited by a moderator:
Back
Top