Hi,
I'm currently trying to cross compile a CMake based QT project for
Windows using MXE but I'm getting a whole load of undefined references
(abbreviated):
...
/home/matt/Documents/Scratch/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/lib/libtiff.a(tif_lzma.o):
In function `LZMAPreEncode':
/home/matt/Documents/Scratch/mxe/tmp-tiff/tiff-4.0.1/libtiff/tif_lzma.c:265:
undefined reference to `lzma_stream_encoder'
/home/matt/Documents/Scratch/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/lib/libtiff.a(tif_lzma.o):
In function `LZMAPreDecode':
/home/matt/Documents/Scratch/mxe/tmp-tiff/tiff-4.0.1/libtiff/tif_lzma.c:154:
undefined reference to `lzma_stream_decoder'
/home/matt/Documents/Scratch/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/lib/libtiff.a(tif_lzma.o):
In function `TIFFInitLZMA':
/home/matt/Documents/Scratch/mxe/tmp-tiff/tiff-4.0.1/libtiff/tif_lzma.c:460:
undefined reference to `lzma_lzma_preset'
...
/home/matt/Documents/Scratch/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/lib/libmng.a(libmng_cms.o):libmng_cms.c:(.text+0xaab):
undefined reference to `cmsCreateTransform'
/home/matt/Documents/Scratch/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/lib/libmng.a(libmng_cms.o):libmng_cms.c:(.text+0xae5):
undefined reference to `cmsCreateTransform'
/home/matt/Documents/Scratch/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/lib/libmng.a(libmng_cms.o):libmng_cms.c:(.text+0xba1):
undefined reference to `cmsDoTransform'
collect2: error: ld returned 1 exit status
make[2]: *** [src/placer/placer.exe] Error 1
make[1]: *** [src/placer/CMakeFiles/placer.dir/all] Error 2
make: *** [all] Error 2
The project builds fine with my native compiler and my CMakeLists.txt
files include FIND_PACKAGE(Qt4 REQUIRED)
and TARGET_LINK_LIBRARIES(placer ${QT_LIBRARIES}). I'm pretty new to
CMake and MXE so I'd be really grateful if someone could suggest what
might be wrong.