[SDL] Fwd: about SDL Library Problem...

Yu-Sheng, Wang yaushung at gmail.com
Wed Jul 21 19:34:11 PDT 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100721/785c87fc/attachment.htm>


More information about the SDL mailing list