Page 1 of 1

Compile problem - libm.a & libc.a on Kubuntu 8.10 [wii, PPC]

Posted: Sat Jul 25, 2009 6:58 pm
by Slappy
Hi
I have problem with compiling my game for Wii.
System: AMD-32bit, Kubuntu 8.10, DevkitPPC r17, libogc - latest from svn compiled by myself

I got this error:

Code: Select all

slappy@SlappyhoAsus:~/programming/devkitpro/wii-examples/quadrax$ make
linking ... quadrax.elf
/usr/lib/libSDL.a(SDL_wii_main.o): In function `main':
C:\Users\Daryl\Desktop\Projects\wiiapple\SDL/src/main/wii/SDL_wii_main.c:74: multiple definition of `main'
main.o:/home/slappy/programming/devkitpro/wii-examples/quadrax/source/main.cpp:1854: first defined here
/home/slappy/programming/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-gekko/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/home/slappy/programming/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-gekko/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
collect2: ld returned 1 exit status
make[1]: *** [/home/slappy/programming/devkitpro/wii-examples/quadrax/quadrax.elf] Error 1
make: *** [build] Error 2
Actually I am NOT using any code from libm or libc
When I tried to compile code on DevkitPPC r17 - Win-32 [at my work PC] it was compiled succesfully
I am using SDL - but that is fine...
Maybe Kubuntu is using some type of zlib compression for .elf files or whatever, because -lz -logc and -lm I removed from OC-Win build and all was fine.
makefile:

Code: Select all

LIBS	:= -lSDL_ttf -lSDL_gfx -lSDL_mixer -lSDL_image -lfreetype -ljpeg -lpng -lz -lSDL -lfat -lwiiuse -lbte -logc -lm

Re: Compile problem - libm.a & libc.a on Kubuntu 8.10 [wii, PPC]

Posted: Sat Jul 25, 2009 11:32 pm
by WinterMute
Actually you'll find it kind of difficult to build anything significant without using code from libc & libm.

Your main problem is that wii SDL should not be installed in /usr - this is likely to cause issues with your machine. The second problem you have is that SDL is set up to override main but you haven't included SDL.h in main.cpp.

Move your SDL libs somewhere else, I'd suggest $DEVKITPRO/other/ or something similar in order to keep it completely separate from the devkitPro released libraries. Right now we don't support the available wii SDL ports but we do have plans to get them tidied up and building correctly in the future.

Re: Compile problem - libm.a & libc.a on Kubuntu 8.10 [wii, PPC]

Posted: Sun Jul 26, 2009 10:02 am
by Slappy
Hi

Thanks, now it works
Solution: :idea:

Code: Select all

I deleted all libSDL_*.a libraries from /usr/lib/
I copied all of them to devkitpro/libogc/lib/wii/ 
And header files [whole SDL directory] into devkitpro/libogc/include/ 
It works fine now, no libm/libc problems :roll: