prelimary mingw cross compile instructions

Ralf Habacker ralf.habacker at freenet.de
Sat Apr 9 22:58:52 CEST 2005


On Saturday 09 April 2005 17:37, Daniel Verite wrote:
>  Ralf Habacker wrote:
> > search for AUTOTHREAD in configure. There you find a message that
> > qmake.conf / QMAKE_LIBS_THREAD has to be set to the threading libary
>
> Then I've added
> QMAKE_LIBS_THREAD =
> into mkspecs/win32-g++/qmake.conf
> then reconfigured, and indeed that fixes the mt- problem. Cool.
>
> Now about libqtmain that isn't built.
> A compilation failure is reported on qtcrtentrypoint.cpp pretending that
> _fpreset() is not declared.
> Actually it is declared in /usr/i586-mingw32msvc/float.h but the
> preprocessor picks up /usr/lib/gcc-lib/i486-linux/3.3.5/include/float.h
> instead. I believe that the first one would be supposed to include the
> latter (through include_next) but this does not happen since the include
> path is set the other way round. Looks like a configuration issue for the
> debian mingw32 package.
>
> Anyway, manually adding extern "C" { void _fpreset(); } in
> qtcrtentrypoint.cpp makes it compilable.

> There are also the dos commands (copy, del, move) that make will fail to
> launch.This can be fixed by editing  mkspecs/win32-g++/qmake.conf:
>
> QMAKE_COPY              = cp
> QMAKE_MOVE              = mv
> QMAKE_DEL_FILE          = rm
>
> Finally, I've noted that for me, the examples are compiled as libraries
> instead of executables. For instance, for aclock, qmake generates a
> TARGET=aclock.dll along with this link command:
>
> i586-mingw32msvc-g++ -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import
> -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl,-s -Wl,-subsystem,windows
> -shared -Wl,--export-all-symbols -Wl,--out-implib,libaclock.a -o
> aclock.dll .obj/release-shared-mt/aclock.o .obj/release-shared-mt/main.o
> .obj/ release-shared-mt/moc_aclock.o -L"/home/daniel/src/qt-3/lib" -lqtmain
> -lqt-mt -lopengl32 -lglu32 -lkernel32 -luser32 -lgdi32 -lcomdlg32
> -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -limm32 -lwinmm -lwsock32
> -lwinspool
>
> That I couldn't figure out at all. It would be of interest for people that
> would want to cross-compile their applications in addition to Qt itself.

This configure bug  I've tried to fix on 
http://sourceforge.net/project/shownotes.php?release_id=318305 with topic 7 
and 10. I've found out, that if a configure took place using -shared the term 
dll is added to .qmake.cache's CONFIG line. This is interpreted by qmake 
creating a dll anyway. 

I don't know if you are familiar enough to fix this bug, but if it would be 
nice to get a patch, which I can use to setup an additional mkspecs subdir 
for example win32-g++-linux or so to enable out of the box cross-compiling. 

Nice work. 

regards
Ralf 






> Regards,


More information about the kde-cygwin mailing list