GP2X Help! Dev -c++


mattyrb

Member
Joined
Mar 30, 2005
Messages
151
Hi,
I'm a newbie with C++, I've got the zip demo.rar to compile as a gpe on my machine, however people have told me I can test as an EXE with Dev-C++....I can't for the life of me get this too work! how'd you set it up!?!?!

Any help would be greatfully be taken :)
 
I have no Dev-C++ here, but as far as I remember, after installing Dev-C++, you should be able to compile that code and make it work on your machine, since Dev-C++ tries to build it using the default compiler (which is already set up).

Then, in order to build the GPE executable, you should go to Tools->Compiler Options, and create new compiler settings so that it points to the proper compiler, includes and libs. After that, just go to Project Properties change the compiler, and rebuild.
 
I'm using Dev C++ too.
Whilst I seem to have configured it to compile individual files, I can't seem to get projects compiling. I get 'no input files'.
If I run the makefile from the command line it works just not from Dev C++.
It's probably a working directory thing.
Does anyone know how to fix this?
I seem to remember a tutorial for Dev C++ & GP2X but I can't find it for the life of me, does anyone know where it is?
 
Hi!

I'm also new to developing for the GP2X (but then again, isn't everybody?).

As far as I understand I have the contrary problem to mattyrb. I've got a number of DevC++/SDL programs waiting to be ported to the GP2X. I know I can set DevC++ to cross-compile somehow, but how exactly? What paths need to be changed how? which programs need to be changed?

I would be gratful for any help!

thanks!

RomanH
 
Galleon: Sorry, but the lack of a description of "how to set up DevC++ for the GP2X" in the wiki is exactly my problem and as soon as I have successfully set it up I promise I will write a tutorial for the wiki.

(Well, my real problem ist that I have some knowledge of c programming but no idea on how to configure an ide without instructions. But I wont give up and just try different things until it works... )
 
If you already have the DevkitGP2X or another cross compiler ready, just go into Compiler Options, and go to the Cincludes and C++includes tabs. Replace all the paths there with the equivalents from DevkitGP2X, and then move onto the binaries tab, and esentially do the same :) easy, it worked for me no problems. Please note that this is an approximation of the solution from memory, and I can't yet test it because I'm at school at the minute.

On another note, the version of GCC.MingW the newest version of Dev-Cpp comes with appears to have problems compiling SDL programs! So update it to the newest version ASAP.
 
Thanks for the help!

I would be very greatful if you maybe could describe how it works in more detail when you've got more time. (or maybe send some screenshots of the different tabs to me? romanh - at - gmx - dot - ch)

Once again thanks!!! :)

RomanH
 
Once again, I'm at school when I read this :( *Doh!*

I'll re-test it when I get home tonight, and if there isn't something on it already I guess I'll add to the Wiki (anyone can post once they have an account right? I just need to set up an account there then I'll write it). It is a simple process really, and I did it without very much knowledge at all- mostly it was "educated" guesses ;)

Only problem is that I don't have a GP2X yet! So I'm not entirely sure my outputted binaries are valid! But I reckon they are... it seems unlikely that it would have failed entirely. I definitely get output binaries that use an instruction set that my computer doesn't recognise (It's AMD Athlon XP, which I'm pretty damn sure is x86 architecture, running WinXP). This being based on the error messages I get trying to run the binary ;)
 
Cool! Thank you Ferentix! :)

My GP2X should arrive early next week. I'll let you know how it worked.

thanks!

RomanH
 
I'm sorry, but I'm just too stupid...

I followed your instructions in the wiki and tried to compile the devkitGP2X demo SDL-Program and get the following error message: cannot find -lgmon

since the .o file is created I assume this is a linker problem. Am I missing some parameters?

thanks!

Roman
 
Oh man, bad one :( Sorry...

See, I made a clean install of DevC++ and DevkitGP2X just for this article, and followed my own instructions as I wrote them. And at the end it worked fine. I didn't use any linker parameters... OTOH, I had not actually tried compiling an SDL program, just a simple main() function that didn't actually contain any instructions.

Damn, I'm going to have to do a little reading, and try to compile that demo myself. Where did you get the demo please? Also, do you have all the GP2X SDL libraries?

EDIT: And just noticed that Nickspoon added the info on making it name files *.gpe instead of *.exe :) Open Wiki documentation is a great thing :D
 
the demo can be found in C:\devkitGP2X\demo

I just tried a simple main() function without any instructions and got the same errors. Seems like it has nothing to do with SDL-Stuff at all.

I'll keep on trying... :)
 
Hmm, that's strange :confused:

In fact, now that I've got the SDL libraries and a demo source from GuyFawkes guide, I'm turning over a huge list of errors...

I'm pretty sure, however, that my instructions on configuring Dev-C++ for DevKitGP2X are fairly accurate... I must be missing something somewhere though (unless, of course it's a compiler or library issue, though I doubt it)
 
The errors might be because the demo says:
#include "sdl/SDL.h"

which should probably be:
#include "sdl/SDL.h"

however, this does not solve the cannot find -lgmon thing...
 
Right, I fixed my own problems... I have no idea about yours though I'm afraid. I assume you meant you have to change "SDL.h" to "SDL/SDL.h". In this setup that is indeed true. I'd done that, and now I have successfully compiled a binary. Whether it works on GP2X or not is still another matter, but I will add the updated info to the Wiki page :)

Basically, I simply added the linker commands -lSDLmain -lSDL to the linker options box for the project. However, this would not fix your problem, whatever it is, because you say that it happens with non-SDL programs too... I don't know enough about the subject to really hazard a guess at what lgmon is and why it expects to find it :huh:
 
Ferentix: I've just tried your tutorial from the wiki on the computer at work (don't tell anyone B) ) and it worked! I can now build programs for the GP2X with DevC++! Thanks! Now I just have to set up this computer to build SDL programs and wait for my GP2X to arrive and it will be a wonderful christmas!!! :D

Thanks!

RomanH

(however, I still don't know why it doesn't work on my computer at home...)
 
Back
Top