Cross-compile sdl

when changing compiler to cross compile, if using
the option --enable-shared ,after typing make,
a error will be generated:

/usr/lib/libm.so:could not read symbols:Invalid operation
collect2: ld returned 1 exit status
make[2]:***[libsdl.la]error 1

but if using --disable-shared ,cross compiling will be successful

why?

Regards,
Andy

Are you compiling for uclinux? If so then I believe the toolchain does not
support dynamic linking. And if you are statically linking then of course it
needs to find the cross-compiled versions of the libraries.> ----- Original Message -----

From: huangwei@sunplus.com.cn
To: sdl at libsdl.org
Sent: 1/5/03 8:19 PM
Subject: [SDL] cross-compile sdl

when changing compiler to cross compile, if using
the option --enable-shared ,after typing make,
a error will be generated:

/usr/lib/libm.so:could not read symbols:Invalid operation
collect2: ld returned 1 exit status
make[2]:***[libsdl.la]error 1

but if using --disable-shared ,cross compiling will be successful

why?

Regards,
Andy


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

That’s mean if cross-compiling sdl for uclinux,
the options --disable-shared --enable-static must
be used, right?
If so, I have used them when cross-compiling sdl.
but now I barged up against the difficulty post on
this forum a few days ago.
Because I am a jackroo on ascept I need some help.
Thanks…

Regards,
Andy

when cross-compiling sdl,I have barged up against some difficulty as
follows:

1.why do the option (–enable-video-x11-vm --enable-video-x11-dgamouse
–enable-video-x11-xv
–enable-video-x11-xinerama --enable-video-x11-xme and so on) become
the default=yes
into no?
2.and the cross-compiling target platform is not x86,the subdirectory
…/src/video/xfree86
would be cross-compiled ,too.right? then I found that the information
mentioned in README said that on non-x86 Linux platforms, static library
code can’t be linked into
shared libraries.I don’t know what is that mean exactly.

thanks…

Regards,
Andy

hi all,

when cross-compile the demos under …/test:

after adding the directory which there and libsdl.a and libsdlmain.a in
makefile under …/test,there are some errors:
testver.tmp: In function ‘Audio_Available’:
…/SDL-1.2.5/src/audio/arts/SDL_artsaudio.c:142:undefined reference to
’arts_init’


…/SDL-1.2.5/src/video/x11/SDL_x11video.c:94:undefined reference to
’XOpenDisplay’


etc.

how to solve it then??

thanks

Regards,
Andy

hi all,

I have used cross-compiler to compile sdl and generated
the static library libsdl.a and libsdlmain.a and I am sure
that the library path has been added.
but I can’t that compile the demos under the directory …/test/,
the errors have been post this forum before.
It seems that the sdl library can’t been found.

who can tell me what can arose this problem or how to trace it?

Regards,
Andy

Hello huangwei,

Monday, January 13, 2003, 7:33:46 AM, you wrote:

hscc> I have used cross-compiler to compile sdl and generated
hscc> the static library libsdl.a and libsdlmain.a and I am sure
hscc> that the library path has been added.
hscc> but I can’t that compile the demos under the directory …/test/,
hscc> the errors have been post this forum before.
hscc> It seems that the sdl library can’t been found.

hscc> who can tell me what can arose this problem or how to trace it?

I assume that you are using mingw32.
You can try to compile demos like that:

gcc graywin.c -lmingw32 -lSDLmain -lSDL -mwindows
(-mwindows can be omited in some cases)

If it doesn’t work, open source file and replace

#include "SDL.h"
with
#include “SDL/SDL.h”–
Lynx,
http://dotNet.lv mailto:@Anatoly_R