GP2X Prosonic For Gp2x


saxman

Still Fresh
Joined
Sep 7, 2006
Messages
9
I have b een trying to port my game engine from a Windows PC over to the GP2X platform. I am limited in knowledge about the GP2X, and although I'm a programmer, I am limited in knowledge as to how to get certain things ready for compile.

This is what I've done... I download the GP2X SDK for Windows (81.1MB) which includes a modified version of Dev-C++ and all that goodness. I then downloaded allegrov0.3 and put the files in directories that they appear to fit in.

I got it to locate the files and all that stuff, and I fixed a few incompatibilities the compiler was complaining about. However, when it looked like it was finally going to work, the linker struck me with a pile of error messages. All of them say about the same thing:

/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libgcc.a(_somethinghere.oS) uses hardware FP, whereas DrawScreen.gpe uses software FP
failed to merge target specific data of file /gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libgcc.a(_somethinghere.oS)

I'm guessing FP is for floating-point, and I'm guessing it means that the ARM processor doesn't have true floating-point processing and therefore I can't use 'float' and 'double'. Am I on the right track here?

I haven't a clue what to do about this because I've never gotten anything like this. What do I need to do to resolve this?
 
You can use float/double, but it does it through software, and mixing kernel-emulation and gcc-emulation can cause trouble. Also, if your code uses a lot of floating-point stuff, it will be very slow.
 
saxman posted on Dec 31 2006 at 12:44 AM said:
What does that mean for me?
Avoid float and double. I'm serious, I was using floats in my last game I got a HUGE performance boost by removing those.
 
Last edited by a moderator:
Okay but what can I put in place of them? I don't have many floats, but the couple instances I do use them are quite important to the engine. And if I am allowed to use floats, then why do I get those errors?
 
The GPH Official SDK isn't too out-of-date, but really it should only be used for dynamic linking stuff. It uses gcc 3.4 and glibc 2.2.5, while the others use gcc 4.0 and glibc 2.3.5. The glibc version difference means you have to compile statically for stuff to work right on the gp2x when using glibc 2.3.5.
 
Alright, well I did everything that page said to do. I tried to compile my program and now I get simply this:

cannot find -lfloat

Am I missing a library or something?
 
Are you using the -lfloat compiler option? If so, don't. If not, I've only seen it try to auto-include that library on gcc3.4/glibc2.2.5, either get libfloat to compile (you can find it on ftp servers all over) or use gcc4.0/glibc2.3.5 with oopo's toolchain or devkitgp2x.
 
Uhh... Well, you'll have to actually compile Allegro using your Dev-C++ environment if you want to continue to use Dev-C++ to compile your games...

Anyways, many libraries are compiled to use Hardware floats, which, as mentioned above, causes them to be emulated through the kernel since the GP2x doesn't actually have hardware floats. Software floats are actually faster. But GCC 4.0 is definitely something you'll want. You may have to learn how to use the bash and write Makefiles, but in the end its worth it...

As mentioned, its possible to use Code::Blocks to write code, just ensure that you get a CVS build.

...But honestly, i think real Linux is the best way to do it... I figured out how to screw with Knoppix and stuff, if anyone wants a GP2X live CD made...
 
The GPH Official SDK isn't too out-of-date, but really it should only be used for dynamic linking stuff. It uses gcc 3.4 and glibc 2.2.5, while the others use gcc 4.0 and glibc 2.3.5. The glibc version difference means you have to compile statically for stuff to work right on the gp2x when using glibc 2.3.5.
That's not totally true: GPH dev kit has two versions of the toolchains:
- the standard one with gcc 3.4.6 and glibc 2.2.5 (probably the one used to compile the firmware)
- a more recent one with gcc 4.0.3 and glib 2.3.6 which you build by running "buildgp2xtools.sh static"; note the name of the argument: *static* ;)
 
Last edited by a moderator:
saxman posted on Dec 31 2006 at 03:05 PM said:
Alright, well I did everything that page said to do. I tried to compile my program and now I get simply this:

cannot find -lfloat

Am I missing a library or something?
You shouldn't need to link -lfloat. Did you add that to the linker yourself?
 
Last edited by a moderator:
Back
Top