[SDL] Fwd: about SDL Library Problem...
Yu-Sheng, Wang
yaushung at gmail.com
Sun Jul 25 20:49:09 PDT 2010
Thnaks reply,
while I use the command Andrey provide, I encounter other problem,
collect the infomation:
$ arm-none-linux-gnueabi-gcc hello.c -o hello -static
-I/usr/local/include/SDL -L/usr/local/lib -Wl,-Bstatic -lSDL -lpthread -ldl
-lm
cc1: warning: include location "/usr/local/include/SDL" is unsafe for
cross-compilation
/home/acos/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/ld:
warning: library search path "/usr/local/lib" is unsafe for
cross-compilation
/usr/local/lib/libSDL.a(SDL_DirectFB_video.o): In function
`SetDirectFBerror':
/home/acos/SDL-1.2.14/./src/video/directfb/SDL_DirectFB_video.c:220:
undefined reference to `DirectFBErrorString'
/usr/local/lib/libSDL.a(SDL_DirectFB_video.o): In function
`DirectFB_SetVideoMode':
/home/acos/SDL-1.2.14/./src/video/directfb/SDL_DirectFB_video.c:632:
undefined reference to `DirectFBError'
/usr/local/lib/libSDL.a(SDL_DirectFB_video.o): In function
`DirectFB_VideoInit':
/home/acos/SDL-1.2.14/./src/video/directfb/SDL_DirectFB_video.c:389:
undefined reference to `DirectFBInit'
/home/acos/SDL-1.2.14/./src/video/directfb/SDL_DirectFB_video.c:396:
undefined reference to `DirectFBCreate'
collect2: ld returned 1 exit status
On Sat, Jul 24, 2010 at 3:14 AM, Andrey A. <fheroes2 at gmail.com> wrote:
> LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./hello
>
> or static build:
> $ arm-none-linux-gnueabi-gcc test.c -o hello -static
> -I/usr/include/SDL -L/usr/lib -Wl,-Bstatic -lSDL -lpthread -ldl -lm
>
> 2010/7/22, Yu-Sheng, Wang <yaushung at gmail.com>:
> > Hi,
> >
> > I encounter some problems during making the library,
> >
> > I would like to port SDL library on my embedded device,
> >
> > My devices is OMAP 3621 (ARMv7), operating system is Linux 2.6.32.7,
> >
> > and I use Sourcery G++ Lite 2008q3-72 as the toolchain,
> >
> > below is my process...
> >
> > 1. configure
> > ./configure \
> > --enable-static \
> > --enable-shared \
> > --enable-audio \
> > --enable-video \
> > --enable-loadso \
> > --enable-nanox-direct-fb \
> > --enable-video-fbcon \
> > --enable-video-directfb \
> > --disable-esd \
> > --target=arm-none-linux-
> > gnueabi \
> > --host=arm-none-linux-gnueabi \
> > --enable-rpath
> >
> > 2. Make and install
> > make
> > make install
> >
> > 3. Copy the lib files to the target board
> > [on the target board]
> > lrwxrwxrwx 1 root root 20 Jan 1 00:46
> > /usr/local/lib/libSDL-1.2.so.0 -> libSDL-1.2.so.0.11.3
> > -rwxr-xr-x 1 root root 954098 Jan 1 00:38
> > /usr/local/lib/libSDL-1.2.so.0.11.3
> > -rwxr-xr-x 1 root root 1388774 Jan 1 00:38
> > /usr/local/lib/libSDL.a
> > -rwxr-xr-x 1 root root 946 Jan 1 00:38
> > /usr/local/lib/libSDL.la
> > lrwxrwxrwx 1 root root 20 Jan 1 00:46
> > /usr/local/lib/libSDL.so -> libSDL-1.2.so.0.11.3
> > -rwxr-xr-x 1 root root 3666 Jan 1 00:38
> > /usr/local/lib/libSDLmain.a
> >
> > 4. Write an easy sample code
> > #include <stdlib.h>
> > #include <stdio.h>
> > #include "SDL.h"
> >
> > main(int argc, char *argv[])
> > {
> > printf("\n\n======>1\n");
> > if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 ) {
> > fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
> > exit(1);
> > }
> > printf("\n\n======>2\n");
> > atexit(SDL_Quit);
> > }
> >
> > 5. Compile
> > $ arm-none-linux-gnueabi-gcc -I/usr/local/include/SDL -L/usr/local/lib
> -lSDL
> > hello.c -o hello
> > cc1: warning: include location "/usr/local/include/SDL" is unsafe for
> > cross-compilation
> >
> /home/acos/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/ld:
> > warning: library search path "/usr/local/lib" is unsafe for
> > cross-compilation
> >
> > 6. Execute hello
> > [on board]
> > # sh hello
> > hello: line 1: syntax error: unexpected word (expecting ")")
> > # ./hello
> > ./hello: error while loading shared libraries: /lib/libSDL-1.2.so.0: ELF
> > file version does not match current one
> >
> > any one can help me...? PLEASE
> >
> > --
> > 王鈺勝 Yu-Sheng, Wang
> >
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
--
王鈺勝 Yu-Sheng, Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100725/2c10ba98/attachment.htm>
More information about the SDL
mailing list