I am trying to cross-compile a simple SDL application for an ARM processor.
I use a Motorola A1200 with Intel Xscale PX27x rev 7 support (with iwmmxt processor) and a modified cross-compilation toolchain, for example, gcc:
arm-linux-gnu-g++ --version
arm-linux-gnu-g++ (GCC) 3.3.6
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ arm-linux-gnu-g++ -v
Reading specs from /opt/crosstool/bin/../lib/gcc-lib/arm-linux-gnu/3.3.6/specs
Configured with: /home/nuso2f/mkezx-0.9.20/build/host/crosstool-ezx/configure --host=i486-host_linux-gnu --target=arm-linux-gnu --prefix=/home/nuso2f/mkezx-0.9.20/build/host/crosstool-ezx.fake_root --with-cpu=iwmmxt --enable-cxx-flags=-mcpu=iwmmxt --with-float=soft --with-headers=/home/nuso2f/mkezx-0.9.20/build/host/crosstool-ezx.fake_root/arm-linux-gnu/include --with-local-prefix=/home/nuso2f/mkezx-0.9.20/build/host/crosstool-ezx.fake_root/arm-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++,f77 --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 3.3.6
Honestly, this compiler was not compiled by me, so the above paths are invalid.
And some directory with libraries like libSDL libSDL_mixer etc. I checked all of these libraries if they are for ARM.
$ file *.so*
ELF 32-biarm-linux-gnu-g++ ttt.cpp -o ttt.arm -I/usr/include -L`pwd`
So they are.
Then I copied libSDL-1.2.so to the project directory. Verified characters from this library
readelf --syms libSDL-1.2.so
All perfectly.
:
( , arm-linux-gnu-g++ ($ CXX) , $LD, $AR , )
$ arm-linux-gnu-g++ ttt.cpp -o ttt.arm -I/usr/include -L`pwd`
/tmp/ccXpDX0V.o(.text+0xb0): In function `main':
: undefined reference to `SDL_Init'
/tmp/ccXpDX0V.o(.text+0xd8): In function `main':
: undefined reference to `SDL_SetVideoMode'
/tmp/ccXpDX0V.o(.text+0x170): In function `main':
: undefined reference to `SDL_UpperBlit'
/tmp/ccXpDX0V.o(.text+0x17c): In function `main':
: undefined reference to `SDL_Flip'
/tmp/ccXpDX0V.o(.text+0x1c8): In function `main':
: undefined reference to `SDL_PollEvent'
/tmp/ccXpDX0V.o(.text+0x2d8): In function `$a':
: undefined reference to `SDL_FillRect'
/tmp/ccXpDX0V.o(.text+0x334): In function `myabort(char const*)':
: undefined reference to `SDL_GetError'
/tmp/ccXpDX0V.o(.text+0x380): In function `my_img_load(char*)':
: undefined reference to `SDL_RWFromFile'
/tmp/ccXpDX0V.o(.text+0x390): In function `my_img_load(char*)':
: undefined reference to `SDL_LoadBMP_RW'
/tmp/ccXpDX0V.o(.text+0x3b8): In function `my_img_load(char*)':
: undefined reference to `SDL_DisplayFormatAlpha'
/tmp/ccXpDX0V.o(.text+0x3c8): In function `my_img_load(char*)':
: undefined reference to `SDL_FreeSurface'
collect2: ld returned 1 exit statust LSB shared object, ARM, version 1, dynamically linked, stripped
,
arm-linux-gnu-g++ ttt.cpp -o ttt.arm -I/usr/include ./libSDL-1.2.so
() SDL, , qt- ( , , SDL), , , , .
, :
- ?
-L gcc- ?
(, , , ) ?