On Thu, 12 Jun 2003 14:44:08 -0400 Jay Greig <greig@qnx.com> wrote:
Ok. Some more info on what I do:
I cross compiled SDL ( current cvs ) with the dinkum libs (there’s no libstdc++ in the gcc
toolchain for ppcbe). Since I dind’t found way to do it with qcc -V using the --target mechanism
from configure, I set up the proper environment (CC and CXX pointing at qcc -V gcc_ntoppcbe_cpp, LD,
AR, NM and RANLIB to ntoppc-* ) and faked configure that it’s using a
cross-compiler (cross_compiling=yes before the check - without setting the ppc target).
The library was built without any problems (as a static lib) - I run nm and file on the packed
object file and everithing seamed fine.
Then I tryed to compile one of the tests with the produced static lib ( libSDL.a ) with the
following options:
qcc -V gcc_ntoppcbe_cpp -static -o testbitmap -I/home/long/target/include/SDL
-L/home/long/target/lib -lSDL -lm -lph testbitmap.c
and the result was:
/tmp/AAA356377_cc.o: In function LoadXBM': /tmp/AAA356377_cc.o(.text+0x44): undefined reference to
SDL_CreateRGBSurface’
/tmp/AAA356377_cc.o(.text+0x44): relocation truncated to fit: R_PPC_REL24 SDL_CreateRGBSurface
/tmp/AAA356377_cc.o(.text+0x5c): undefined reference to SDL_GetError' /tmp/AAA356377_cc.o(.text+0x5c): relocation truncated to fit: R_PPC_REL24 SDL_GetError /tmp/AAA356377_cc.o: In function
main’:
/tmp/AAA356377_cc.o(.text+0x218): undefined reference to SDL_Init' /tmp/AAA356377_cc.o(.text+0x218): relocation truncated to fit: R_PPC_REL24 SDL_Init /tmp/AAA356377_cc.o(.text+0x228): undefined reference to
SDL_GetError’
/tmp/AAA356377_cc.o(.text+0x228): relocation truncated to fit: R_PPC_REL24 SDL_GetError
/tmp/AAA356377_cc.o(.text+0x256): undefined reference to SDL_Quit' /tmp/AAA356377_cc.o(.text+0x25a): undefined reference to
SDL_Quit’
/tmp/AAA356377_cc.o(.text+0x3fc): undefined reference to SDL_SetVideoMode' /tmp/AAA356377_cc.o(.text+0x3fc): relocation truncated to fit: R_PPC_REL24 SDL_SetVideoMode /tmp/AAA356377_cc.o(.text+0x41c): undefined reference to
SDL_GetError’
/tmp/AAA356377_cc.o(.text+0x41c): relocation truncated to fit: R_PPC_REL24 SDL_GetError
/tmp/AAA356377_cc.o(.text+0x450): undefined reference to SDL_LockSurface' /tmp/AAA356377_cc.o(.text+0x450): relocation truncated to fit: R_PPC_REL24 SDL_LockSurface /tmp/AAA356377_cc.o(.text+0x460): undefined reference to
SDL_GetError’
/tmp/AAA356377_cc.o(.text+0x460): relocation truncated to fit: R_PPC_REL24 SDL_GetError
/tmp/AAA356377_cc.o(.text+0x51c): undefined reference to SDL_UnlockSurface' /tmp/AAA356377_cc.o(.text+0x51c): relocation truncated to fit: R_PPC_REL24 SDL_UnlockSurface /tmp/AAA356377_cc.o(.text+0x534): undefined reference to
SDL_UpdateRect’
/tmp/AAA356377_cc.o(.text+0x534): relocation truncated to fit: R_PPC_REL24 SDL_UpdateRect
/tmp/AAA356377_cc.o(.text+0x58c): undefined reference to SDL_PollEvent' /tmp/AAA356377_cc.o(.text+0x58c): relocation truncated to fit: R_PPC_REL24 SDL_PollEvent /tmp/AAA356377_cc.o(.text+0x64c): undefined reference to
SDL_UpperBlit’
/tmp/AAA356377_cc.o(.text+0x64c): relocation truncated to fit: R_PPC_REL24 SDL_UpperBlit
/tmp/AAA356377_cc.o(.text+0x660): undefined reference to SDL_UpdateRects' /tmp/AAA356377_cc.o(.text+0x660): relocation truncated to fit: R_PPC_REL24 SDL_UpdateRects /tmp/AAA356377_cc.o(.text+0x690): undefined reference to
SDL_FreeSurface’
/tmp/AAA356377_cc.o(.text+0x690): relocation truncated to fit: R_PPC_REL24 SDL_FreeSurface
cc: /usr/bin/ntoppc-ld error 1
I can provide you with the sources and the build scripts that I used if you wish.
Best Regards,
Alexander
What is your host system? What is the whole command you are using?
With the source foo.c:
#include <stdio.h
int main()
{
fprintf(fdopen(0, “w”), “Hello World\n”);
return 0;
}
I compile it as:
qcc -Vgcc_ntoppcbe -o foo foo.c
And I see:
foo
Hello World
Previously, Alexander Popov wrote in qdn.public.qnxrtp.powerpc:
Hi all,
I just got the 6.2.1a Pro version of QNX and I’m trying to port some stuff to ppcbe.
But I constantly get errors from the linker simmilar to this one:
/tmp/AAA946985_cc.o(.text+0x480): undefined reference to `fprintf’
/tmp/AAA946985_cc.o(.text+0x480): relocation truncated to fit: R_PPC_REL24 fprintf
I tryed using qcc with poth -V gcc_ntoppcbe and -V gcc_ntoppcbe_cpp.
Am I missing something?
Regards,
Alexander Popov ProSyst Bulgaria Inc.
Team Leader 48 Vladajska Str.
Dept: Real Time OS and Java VM Sofia 1606, Bulgaria
Phone: +359 2 952 35 81/203 > http://www.prosyst.com
Mobile: +359 87 663 193 OSGi Technology Leaders
\
-Jay.
–
Alexander Popov ProSyst Bulgaria Inc.
Team Leader 48 Vladajska Str.
Dept: Real Time OS and Java VM Sofia 1606, Bulgaria
Phone: +359 2 952 35 81/203 http://www.prosyst.com
Mobile: +359 87 663 193 OSGi Technology Leaders