Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Allegro 4.4.1.1 CrossCompile Errors

This thread is locked; no one can reply to it. rss feed Print
Allegro 4.4.1.1 CrossCompile Errors
MWPaus
Member #15,672
July 2014

Hi guys,

Im trying to cross compile 4.4.1.1 using buildroot for ARM on a Linux x64 host.

Im compiling with the options: -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_COLOR_MAKEFILE=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DUSE_CCACHE=OFF -DWANT_MODULES=off -DWANT_X11=off -DWANT_LINUX_CONSOLE=off -DWANT_LINUX_VGA=off -DWANT_LINUX_FBCON=on -DWANT_LINUX_SVGALIB=off -DWANT_ALLEGROGL=off -DWANT_LOADPNG=on -DWANT_LOGG=off -DWANT_JPGALLEG=on -DWANT_EXAMPLES=on -DWANT_TOOLS=on -DWANT_TESTS=off

These are the compilation errors im seeing... any idea what the cause is?
Thanks!

[code]
make[3]: Entering directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
[ 49%] Building C object addons/loadpng/CMakeFiles/loadpng.dir/loadpng.c.o
Dependee "/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/examples/CMakeFiles/ex3d.dir/DependInfo.cmake" is newer than depender "/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/examples/CMakeFiles/ex3d.dir/depend.internal".
Dependee "/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/examples/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/examples/CMakeFiles/ex3d.dir/depend.internal".
Scanning dependencies of target ex3d
make[3]: Leaving directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
make[3]: Entering directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
[ 50%] Building C object examples/CMakeFiles/ex3d.dir/ex3d.c.o
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_rgb_scale_5x35'
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_rgb_map'
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_indexed_palette'
collect2: error: ld returned 1 exit status
make[3]: *** [examples/ex12bit] Error 1
make[3]: Leaving directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
make[2]: *** [examples/CMakeFiles/ex12bit.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_rgb_scale_5x35'
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_rgb_map'
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_indexed_palette'
collect2: error: ld returned 1 exit status
make[3]: *** [examples/ex3buf] Error 1
make[3]: Leaving directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
make[2]: *** [examples/CMakeFiles/ex3buf.dir/all] Error 2
[ 50%] [ 50%] Building C object addons/loadpng/CMakeFiles/loadpng.dir/savepng.c.o
Building C object addons/loadpng/CMakeFiles/loadpng.dir/regpng.c.o
/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/addons/loadpng/loadpng.c:22:30: error: 'Z_BEST_COMPRESSION' undeclared here (not in a function)
int _png_compression_level = Z_BEST_COMPRESSION;
^
/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/addons/loadpng/loadpng.c: In function 'really_load_png':
/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/addons/loadpng/loadpng.c:98:9: warning: variable 'tRNS_to_alpha' set but not used [-Wunused-but-set-variable]
int tRNS_to_alpha = FALSE;
^
make[3]: *** [addons/loadpng/CMakeFiles/loadpng.dir/loadpng.c.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
make[2]: *** [addons/loadpng/CMakeFiles/loadpng.dir/all] Error 2
Linking C executable ex3d
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_rgb_scale_5x35'
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_rgb_map'
../lib/liballeg.so.4.4.1: undefined reference to `_colorconv_indexed_palette'
collect2: error: ld returned 1 exit status
make[3]: *** [examples/ex3d] Error 1
make[3]: Leaving directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
make[2]: *** [examples/CMakeFiles/ex3d.dir/all] Error 2
make[2]: Leaving directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1'
make: *** [/data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1/.stamp_built] Error 2
[/code]

Thomas Fjellstrom
Member #476
June 2000
avatar

Did you tell cmake to cross compile with a valid Toolchain file?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

MWPaus
Member #15,672
July 2014

I believe so... buildroot takes care of that.

The full cmake command as run by buildroot:
(cd data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1 && rm -f CMakeCache.txt && PATH="/data/local/cfa920_buildroot/build/host/bin:/data/local/cfa920_buildroot/build/host/sbin:/data/local/cfa920_buildroot/build/host/usr/in:/data/local/cfa920_buildroot/build/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" /data/local/cfa920_buildroot/build/host/usr/bin/cmake data/local/cfa920_buildroot/build/build/allegro4-4.4.1.1 -CMAKE_TOOLCHAIN_FILE="/data/local/cfa920_buildroot/build/host/usr/share/buildroot/toolchainfile.cmake" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_COLOR_MAKEFILE=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON-DUSE_CCACHE=OFF -DWANT_MODULES=off -DWANT_X11=off -DWANT_LINUX_CONSOLE=off -DWANT_LINUX_VGA=off -DWANT_LINUX_FBCON=on -DWANT_LINUX_SVGALIB=off -DWANT_ALLEGROGL=off -DWANT_LOADPNG=on -DWANT_LOGG=off -DWANT_JPGALLEG=on -DWANT_EXAMLES=on -DWANT_TOOLS=on -DWANT_TESTS=off -DWANT_ALSA=off -DWANT_OSS=off -DWANT_JACK=off-DWANT_SGIAUDIO=off -DWANT_VORBIS=off -DWANT_OGG=off -DWANT_LOGG=off )

edit....

Turning off building examples 'fixed' the color conversion issues.

Adding "#include <zlib.h>" to the top of "addons/loadpng/loadpng.c" fixed the Z_BEST_COMPRESSION error.
(someone should fix this)

Go to: