Noob Question


red3king

Still Fresh
Joined
Mar 6, 2007
Messages
3
hi, i am new to gp2x development, but have had experience with c and a small bit with sdl before.

I downloaded and installed the gp2xsdk toolchain, and am trying to use it wiht sdl to make the demo on the wiki.

I go to the dir of the installation, and

Code:
root@ubuntu:/gp2xsdk/Tools/bin# ./arm-gp2x-linux-gcc -lpthread  -lc -lgcc   -lSDL  -o demo ./dev/demo.c
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/bin/ld: ERROR: /gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so uses software FP, whereas demo uses hardware FP
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/bin/ld: failed to merge target specific data of file /gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so: undefined reference to `pthread_cond_signal@GLIBC_2.3.2'
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so: undefined reference to `pthread_cond_broadcast@GLIBC_2.3.2'
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so: undefined reference to `pthread_cond_destroy@GLIBC_2.3.2'
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so: undefined reference to `pthread_cond_timedwait@GLIBC_2.3.2'
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so: undefined reference to `pthread_cond_wait@GLIBC_2.3.2'
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/libSDL.so: undefined reference to `pthread_cond_init@GLIBC_2.3.2'
collect2: ld returned 1 exit status

I have looked around for a few hours, but this is as small as I can get the list of errors.
Can somebody tell me where I went wrong?
thanks
 
telecoda posted on Mar 9 2007 at 12:45 AM said:
Try linking with pthread too but adding -lpthread

Do you mean to add -lpthread? I already have.
 
Last edited by a moderator:
Your toolchain is outputting hardware fp code, you need to output software fp code (as the gp2x doesn't have a hardware fp). You can't mix and match modules with software/hardware fp.

I think there's a command line switch, but can't remember it. The easiest way is probably to upgrade your tool chain.
 
For some odd reason it compiles the program with this:

./arm-gp2x-linux-g++ -static -o test.gpe ./dev/demo.c -L"/gp2xsdk/Tools/arm-gp2x-linux/lib" -lSDL -lpthread

Thanks for the quick replies.
Yay now I can finally make games for the gp2x.
 
red3king posted on Mar 10 2007 at 07:37 PM said:
telecoda posted on Mar 9 2007 at 12:45 AM said:
Try linking with pthread too but adding -lpthread

Do you mean to add -lpthread? I already have.

doh! didn't read your whole post.

Glad you have it sorted.
 
Last edited by a moderator:
Back
Top