Compiling Under Ubuntu


MacGyver

Member
Joined
Jun 7, 2008
Messages
144
Website
Visit site
Hello @ first

i want to start to write some little games for pandora under c++ with sdl.
How can i compile under ubuntu (i386) for pandora (ARM).
Give it a little how to ore anything else ?

Thanks for support
Greats MacGyver
 
First, compile as usual. Pandora will have standard C++ and SDL libraries (as Gp2x has), so just develop, compile, run and test your game in your computer as any other application. Be sure to use the same screen resolution that the Pandora, use a joystick to emulate input and do not worry about fullscreen mode.

Once your game is ready and bug-free, cross-compile it. No mystery here: just use an ARM specific cross-compiler instead of the Ubuntu default C++ compiler. The concrete cross-compiler will be hopefully available once Pandora comes out. At the time being, just do not worry about it.

If you follow these steps and your C++/SDL game compiles and runs ok on a PC, chances that it will run ok on an actual Pandora are really hight with slight or even no modifications.
 
juanvvc said:
Once your game is ready and bug-free, cross-compile it. No mystery here: just use an ARM specific cross-compiler instead of the Ubuntu default C++ compiler. The concrete cross-compiler will be hopefully available once Pandora comes out. At the time being, just do not worry about it.
I wish it were that easy to set up :(
 
Last edited by a moderator:
dbzeag said:
juanvvc said:
Once your game is ready and bug-free, cross-compile it. No mystery here: just use an ARM specific cross-compiler instead of the Ubuntu default C++ compiler. The concrete cross-compiler will be hopefully available once Pandora comes out. At the time being, just do not worry about it.
I wish it were that easy to set up :(


don't be afraid, not really difficult :)

in worst case you 'll be need use Makefile specific for compiling for Pandora as i do for NDS but no need to change the rest of your code :)
 
Last edited by a moderator:
QUOTE

I wish it were that easy to set up :(



In Ubuntu to cross compile for the Gp2x, download and unzip Open2x toolchain. Then run arm-open2x-linux-gcc instead of gcc . It IS that easy to set up :)
 
Thanks for support.
Witch toolchain should i download.
This GCC 3.4.4/gLibC 2.3.6 Open2x Kernel Toolchain or GCC 4.1.1/gLibC 2.3.6 Open2x Applications Toolchain.

Greats MacGyver
 
MacGyver said:
Thanks for support.
Witch toolchain should i download.
This GCC 3.4.4/gLibC 2.3.6 Open2x Kernel Toolchain or GCC 4.1.1/gLibC 2.3.6 Open2x Applications Toolchain.

Neither for Pandora. Please read the Wiki and/or the FAQ :)
 
Last edited by a moderator:
MacGyver, the Open2x toolchain is for the Gp2x. I only mentioned Open2x to prove that setting up a cross compiler is easy enough. Read my first message of this thread and do not worry about Pandora cross compiling at the time being.
 
MacGyver said:
Ok
thanks a lot for all that answers.
Greats MacGyver
The closest thing to the toolchain will likely be the one used by the Maemo project, the CodeSourcery toolchain. However, having said this, until the MK0's become more prevalent and all of the MK0 people help gel the firmware, etc. it might be a bit premature to do anything other than do stuff in x86 against the "dev" toolchain you can fetch via synaptic, aptitude, or simply apt-get on Ubuntu. As long as you're not doing "stupid" things, it should be portable across multiple CPU architectures with minimal fuss.

Some gotchas (not precisely Pandora specific, but in general and definitely not exhaustive):
  1. Treating pointers as "int" entities (This breaks 32-64 bit transitions as "int", under Linux and most POSIX systems, is a 32-bit entity. Pointers can be 32 or 64 bits based on ISA...)
  2. Doing byte-wise operations on things other than strings and not accounting for Big versus Little Endianness...
  3. Doing something that presumes a given byte alignment- some architechtures operate with no padding, some operate with 16, 32, or even 64-bit alignments and your structures will be padded with "unused" space if you're running against an ISA that doesn't allow byte aligned operations.
 
Last edited by a moderator:
Back
Top