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] Using mxe build libraries with native toolcha


From: philippe renon
Subject: Re: [Mingw-cross-env-list] Using mxe build libraries with native toolchain
Date: Fri, 3 Oct 2014 21:46:36 +0100

Hi again,

By commenting out some osg dependencies I was able to compile further but now I hit a wall.
The mingw cross compiler that mxe builds uses the sjlj exception model while Qt uses drawf.
Apparently "everybody is moving to sjlj" except Qt....

Is it possible to make mxe build another mingw version (namely the exact same one as Qt).

On linux, I have built osg with the toolchain that comes with Qt and everything worked fine in our app.
Windows is another story...

Philippe.


Le Vendredi 3 octobre 2014 21h57, philippe renon <address@hidden> a écrit :


Hi,

Thanks for the answer. Got me motivated to try compiling osg natively with MXE built dependencies (gdal, libxml2, ...)
And I reached ~80% compilation before hitting a linking error. Not bad :)

Linking CXX shared module ..\..\..\bin\osgPlugins-3.2.1\mingw_osgdb_tiff.dll
d:\Projects\i686-w64-mingw32\lib\libtiff.a(tif_jpeg.o): In function `TIFFjpeg_destroy':
/home/filnet/mxe/tmp-tiff/tiff-4.0.3/libtiff/tif_jpeg.c:368: undefined reference to `jpeg_destroy'
d:\Projects\i686-w64-mingw32\lib\libtiff.a(tif_jpeg.o): In function `TIFFjpeg_write_raw_data':
/home/filnet/mxe/tmp-tiff/tiff-4.0.3/libtiff/tif_ojpeg.c:1154: undefined reference to `jpeg_std_error'
... <snip> ...
d:\Projects\i686-w64-mingw32\lib\libtiff.a(tif_lzma.o): In function `LZMASetupEncode':
/home/filnet/mxe/tmp-tiff/tiff-4.0.3/libtiff/tif_lzma.c:236: undefined reference to `lzma_end'
d:\Projects\i686-w64-mingw32\lib\libtiff.a(tif_lzma.o): In function `LZMASetupDecode':
/home/filnet/mxe/tmp-tiff/tiff-4.0.3/libtiff/tif_lzma.c:154: undefined reference to `lzma_stream_decoder'
d:\Projects\i686-w64-mingw32\lib\libtiff.a(tif_lzma.o): In function `TIFFInitLZMA':
/home/filnet/mxe/tmp-tiff/tiff-4.0.3/libtiff/tif_lzma.c:460: undefined reference to `lzma_lzma_preset'
collect2.exe: error: ld returned 1 exit status
src\osgPlugins\tiff\CMakeFiles\osgdb_tiff.dir\build.make:97: recipe for target 'bin/osgPlugins-3.2.1/mingw_osgdb_tiff.dl
l' failed

Here is what I did:

1/ compile gdal and libxml2 with _stable_ MXE and MXE_TARGET=i686-w64-mingw32.
This will trigger the compilation of many osg required dependencies.

2/ Natively compile osg 3.2.1 with cmake, and a mingw compiler that comes with Qt.
Step 1/ produces enough dependencies to make the osg cmake script happy and compilation will proceed until hitting the linking error.

A, for now minor, problem is that PNG is not found although it appears when compiling depedencies with mxe.

Cheers,
Philippe.

This is output of cmake configuration (mxe built dependencies are oin d:/Projects/i686-w64-mingw32):
Building osg osg into build/osg
-- The C compiler identification is GNU 4.8.0
-- The CXX compiler identification is GNU 4.8.0
-- Check for working C compiler: d:/Projects/qt-5.2.1/Tools/mingw48_32/bin/gcc.exe
-- Check for working C compiler: d:/Projects/qt-5.2.1/Tools/mingw48_32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: d:/Projects/qt-5.2.1/Tools/mingw48_32/bin/g++.exe
-- Check for working CXX compiler: d:/Projects/qt-5.2.1/Tools/mingw48_32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found OpenGL: opengl32
-- 32 bit architecture detected
-- Found LibXml2: d:/Projects/i686-w64-mingw32/lib/libxml2.a (found version "2.9.1")
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Found CURL: d:/Projects/i686-w64-mingw32/lib/libcurl.a (found version "7.31.0")
-- Could NOT find SDL (missing:  SDL_LIBRARY SDL_INCLUDE_DIR)
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Found JPEG: d:/Projects/i686-w64-mingw32/lib/libjpeg.a
-- Found ZLIB: d:/Projects/i686-w64-mingw32/lib/libz.a (found version "1.2.8")
-- Could NOT find PNG (missing:  PNG_PNG_INCLUDE_DIR)
-- Found TIFF: d:/Projects/i686-w64-mingw32/lib/libtiff.a (found version "4.0.3")
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Success
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Success
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Failed
-- Configuring done



Le Vendredi 3 octobre 2014 7h17, Tony Theodore <address@hidden> a écrit :



On 2 Oct 2014, at 22:06, philippe renon <address@hidden> wrote:

> Hi,
>
> Let's say that I built the gdal library using mxe and now want to use it in a project that is natively built on windows with a mingw toolchain.
> I that possible at all?

In theory, for some packages, it should be a simple matter of copying the headers/libs over. In practice, you may see subtle issues with different linker versions and most likely have to write/modify pkg-config files. Some packages also hard-code absolute paths so the binaries themselves are not movable. In general, MXE is not relocatable.


> I searched the mailing list and got it that mxe is meant to compile complete applications, but is the use case above supported in some way.
> Building the whole application with mxe is not feasible as not all developers working on it have access to a linux.


There’s always Vagrant[1] which is the easiest way to have consistent development environments. You may think it will not perform well, but in the past I’ve found it’s a lot faster than msys.

Cheers,

Tony


[1] https://www.vagrantup.com






reply via email to

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