GP2X Gp2xsdk And Allegro


kablammyman

Still Fresh
Joined
Jun 10, 2006
Messages
20
Sorry to bother you guys...but this allegro problem is pissing me off.

I am using the version of Dev-c++ that comes with the GP2X SDK made just for the gp2x. It is automatically configured for the gp2x and SDL. I was finally able to compile the demo SDL code and run it on my gp2x AND in windows. :)

I want to use allegro also, so, I downloaded allegro for the gp2x (v0.3). I unzip it, and place the files in the corresponding folders.

In Dev-C++, I went to Project->Project options->parameters tab and in the linker I put:
Code:
C:\GP2XSDK\lib\liballeg.a
-lpthread
-static

After that, I went to tools -> compiler options and in the box that says "add the following commands when calling the compiler" I inserted
Code:
 -O2 -Wall -Werror -g `gp2x-allegro-config --cflags debug`

After doing that, I try to compile and I get this error:

C:\GP2XSDK\demo\g++ `gp2x-allegro-config: No such file or directory.
cc1plus C:\GP2XSDK\demo\cc1plus unrecognized command line option "-fcflags`"
C:\GP2XSDK\demo\Makefile.gp2x [Build Error] [gp2x/exhello.o] Error 1

I have the "gp2x-allegro-config" file in my bin AND i copied it to the working directory...so I know its there, but why doesnt the compiler see it?

Please help...I am frustrated with this whole process...I just want to make some games.

thanx
 
Are you using Windows? I don't think Windows supports the back tick, so you may be following instructions that are Linux-only...

Try entering the command manually and typing in the output.
 
Code:
C:\GP2XSDK\lib\liballeg.a

Code:
 -O2 -Wall -Werror -g `gp2x-allegro-config --cflags debug`

Please help...I am frustrated with this whole process...I just want to make some games.

thanx


`foo bar` is a way to tell (most) unix shells to "run the program foo, with argument bar, then replace the whole back-quoted sequence with whatever the program foo wrote to its standard output. Since you use 'C:\', you might not using a unix(-like) shell, and it probably doesn't understand what you're trying to tell it. You'll have to run gp2x-allegro-config --cflags debug by hand, and then replace the back-quoted string with whatever it outputs (that is, if it makes sense: it might be a unix-shell script, expecting a unix(-like) environment, and not work in yours. So if the output is something like "bad command or filename", don't blindly put it in expecting things to work.).

google keywords you might want to try:
mingw
msys
cygwin

P.
 
Forget about DEMOS, just start programming. Buy/rent/download a book about SDL and hands to work. I cannot compile others peoples sources but I can with my code. Dont worry too much about compiling software that is not yours, some times they need weird stuff to be done.

Cheers.
 
Dev-C++ is only for windows. I used instructions about getting allegro setup with Dev-c++ from this post:
http://www.gp32x.de/board/index.php?showtopic=27634

I do have UNIX tools for windows (I can use things like ls and other UNIX command line things) so maybe I can work something out with that.

BTW, I have Allegro games made, I want to easily port them to the gp2x, I can care less about others source code.
 
Last edited by a moderator:
Hey, I got it to work!
1) I did not use the pre-configured dev-cpp that came withe the sdk. I used the normal version.
2) I followed teh wiki ( http://wiki.gp2x.org/wiki/Using_Devcpp ) on getting dev-cpp to work for the gp2x, but heres what I did to make sure things worked.

I got it to work by making sure that dev-cpp found programs that were from the normal dev-cpp setup (make, gdb and windres) by actually going thru the directory in the programs tab, even though the wiki says they are "No equivalent"

Then I had to delete any *.o files i made when trying to compile stuff from the past.

Finially, in project -> project options, then parameters tab (NOT tools ->compilier options !!!)
I put the following in the linker:
Code:
-O2 -Wall -Werror -g `gp2x-allegro-config --cflags debug`

and I put the following in the linker:
Code:
C:\Dev-Cpp\devkitGP2X\lib\liballeg.a
-static
-lpthread

Then I made sure I was NOT using teh default compilier, but the gp2x one i set up.

and bingo-bango, it worked.
Thank you jaesond for your help.
 
Back
Top