mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] MXE, CMake, QT, undefined references


From: Mark Brand
Subject: Re: [Mingw-cross-env-list] MXE, CMake, QT, undefined references
Date: Tue, 25 Sep 2012 20:15:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120904 Firefox/15.0.1 SeaMonkey/2.12.1

Matthew Bucknall wrote:
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.

libtiff has dependencies -ltiff -llzma -ljpeg -lz. You can use pkg-config to list them:

    i686-pc-mingw32-pkg-config --libs libtiff-4

If you can add these libraries to your link command, it should solve the problem.

Mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]