huangwei | 2 Jan 07:49

cross-compiling SDL for uclinux

Dear all,

after cross-compiling sdl-1.2.5,then cross-compile the demos of test
directory,
but only the file testtypes can be compiled successfully.
when cross-compiling SDL-1.2.5, I use option --enable-static
--disable-shared.

there are some errors as follows:
testhread.tmp:In fucntion 'ThreadFunc':
testhread.tmp(.text+0x78):undefined reference to 'SDL_ThreadID'
testhread.tmp(.text+0x108):undefined reference to 'SDL_Delay'
testhread.tmp:In fucntion 'killed':
testhread.tmp(.text+0x1ac):undefined reference to 'SDL_Delay'
testhread.tmp:In fucntion 'main':
testhread.tmp(.text+0x220):undefined reference to 'SDL_Init'
testhread.tmp(.text+0x23c):undefined reference to 'SDL_GetError'
testhread.tmp(.text+0x2a0):undefined reference to 'SDL_Quit'
testhread.tmp(.text+0x2dc):undefined reference to 'SDL_CreateThread'
testhread.tmp(.text+0x304):undefined reference to 'SDL_GetError'
testhread.tmp(.text+0x368):undefined reference to 'SDL_Delay'
testhread.tmp(.text+0x3bc):undefined reference to 'SDL_WaitThread'
testhread.tmp(.text+0x3f4):undefined reference to 'SDL_CreateThread'
testhread.tmp(.text+0x41c):undefined reference to 'SDL_GetError'
testhread.tmp(.text+0x480):undefined reference to 'SDL_Delay'
testhread.tmp(.text+0x4bc):undefined reference to 'SDL_KillThread'
testhread.tmp(.text+0x51c):undefined reference to 'SDL_CreateThread'
testhread.tmp(.text+0x544):undefined reference to 'SDL_GetError'

how to solve it then?
(Continue reading)

Sam Lantinga | 5 Jan 22:17

Re: cross-compiling SDL for uclinux

> Dear all,

> after cross-compiling sdl-1.2.5,then cross-compile the demos of test
> directory,
> but only the file testtypes can be compiled successfully.
> when cross-compiling SDL-1.2.5, I use option --enable-static
> --disable-shared.

> there are some errors as follows:
> testhread.tmp:In fucntion 'ThreadFunc':
> testhread.tmp(.text+0x78):undefined reference to 'SDL_ThreadID'
> testhread.tmp(.text+0x108):undefined reference to 'SDL_Delay'
> testhread.tmp:In fucntion 'killed':
> testhread.tmp(.text+0x1ac):undefined reference to 'SDL_Delay'
> testhread.tmp:In fucntion 'main':
> testhread.tmp(.text+0x220):undefined reference to 'SDL_Init'

It sounds like the SDL library isn't being linked in.
What's your link line?

See ya,
	-Sam Lantinga, Software Engineer, Blizzard Entertainment
huangwei | 6 Jan 02:04

Re: cross-compiling SDL for uclinux

Mr.Sam Lantinga,

As follows it is the steps that I cross-compiling SDL for uclinux

1.using cross-compiling tool to compile SDL,and using --enable-static
  --disable-esd(I don't know why must use this option,if not ,can not
  be compiled successfully),--disable-shared(this is a puzzle to me ,too),
  --prefix=/sdl-lib
2.then make ;make install;

then under the directory ../sdl-lib three files (libSDL.a
,libSDL.la,libSDLmain.a)are
generated.

3.then cross-compile the demos under directory .../test.
  only two files can be compiled successfully(testtypes and testgl);
  the link line is :
  ....
  mipsel-linux-ld -d -r -o $@.tmp ../lib/crt0.o $< $(testver_DEPENDENCIES)
../lib/libc.a
               ../../libgcc.a;
  mipsel-linux-ld -T ../elf2flt.ld -Ur -o $@.elf $@.tmp(the files
testver.tmp and
  testver.elf can be generated)
  mipsel-linux-ld -T ../elf2flt.ld -o $@.gdb $@.tmp (when executing
here,the errors will be
  generated)
  ../elf2flt.ld -p $@.gdb -o $@.flt -r $@.elf
  ....

(Continue reading)


Gmane