PDA

View Full Version : Cross compiling QT3 on Linux, for win32



mjrich
28th February 2006, 22:24
Hello,

I am attempting to cross compile QT3.3.5 on Debian, for win32 (his is simply so that I can avoid having to reboot so frequently). It is possible (or even likely!) that I'm going about this the wrong way, but what I have done is installed mingw32, downloaded the QT/X11 source and configured it with


configure -static -xplatform win32-g++ -prefix /home/foobar/qt3

This fails with an "Internal error", however out of curiosity I commented it out in the code to see how far I could get it to compile. On running make, the following errors appear:


In file included from kernel/qapplication_x11.cpp:47:
/home/foobar/source/qt3/mkspecs/win32-g++/qplatformdefs.h:14:19: tchar.h: No such file or directory
/home/foobar/source/qt3/mkspecs/win32-g++/qplatformdefs.h:15:16: io.h: No such file or directory
/home/foobar/source/qt3/mkspecs/win32-g++/qplatformdefs.h:16:20: direct.h: No such file or directory
/home/foobar/source/qt3/mkspecs/win32-g++/qplatformdefs.h:22:21: windows.h: No such file or directory
make[2]: *** [.obj/release-static/qapplication_x11.o] Error 1

So perhaps there is a better way of going about this ? (Incidentally, the header files do exist, however the same error appears when adding an explicit -I/path/to/headers...).

Any suggestions would be most welcome !

Cheers,

mjrich

ChristianEhrlicher
28th February 2006, 22:49
You can't use the Qt3/x11-version with windows...

mjrich
28th February 2006, 23:00
Yes, however it doesn't seem to be possible to compile the plain QT/win32 sources on Linux either (short of compiling inside of Wine).

So, how does one cross compile QT3 on Linux for win32 ?

Cheers,

mjrich

ChristianEhrlicher
1st March 2006, 07:40
You need the commercial qt3 version from Trolltech. Then this should work

dimitri
5th March 2006, 20:16
You need the commercial qt3 version from Trolltech. Then this should work
I don't hink this would work better with the commercial version than the open source version.

Qt/X11 won't build on Windows or using a cross-compiler tailored for Windows.

Qt/Win won't build on Linux.

Unless you heavily customize Qt and/or the compiling environment.

mjrich
6th March 2006, 01:17
I don't hink this would work better with the commercial version than the open source version.
Qt/X11 won't build on Windows or using a cross-compiler tailored for Windows.
Qt/Win won't build on Linux.
Unless you heavily customize Qt and/or the compiling environment.

Yes, I'd pretty much come to that conclusion after much playing around, wailing and gnashing of teeth. The closest solution I've come to is from silmor.de's Qt4 experiments -- compile the windows libraries on windows, copy them across to Linux where a matching X11 version exists, and then switch between the two using a modified makefile for the the former.

If anyone comes across a simpler method, it would be gratefully received however!

Cheers,

mjrich

wysota
6th March 2006, 03:00
For Qt3 there is no solution. Qt3 Open Source can't be compiled on Windows! You need dedicated commercial version sources for that.

mjrich
6th March 2006, 03:28
Qt3 Open Source can't be compiled on Windows! You need dedicated commercial version sources for that.Well, these Qt3 sources (http://qtwin.sourceforge.net/qt3-win32/index.php) compiled cleanly under Win32, using mingw-g++. Of course, that doesn't solve the initial problem of having to boot into windows, but it does mean that the same QT3/c++ code can (nearly) be compiled to run on both platforms without too many difficulties.

Regards,

mjrich.

ChristianEhrlicher
6th March 2006, 07:47
Well, these Qt3 sources (http://qtwin.sourceforge.net/qt3-win32/index.php) compiled cleanly under Win32, using mingw-g++. Of course, that doesn't solve the initial problem of having to boot into windows, but it does mean that the same QT3/c++ code can (nearly) be compiled to run on both platforms without too many difficulties.

Regards,

mjrich.

But keep in mind that this code isn't from Trolltech. Also there are some bugs which won't be fixed anymore now that Qt4/gpl is out.
But it is (or better: was) possible to cross-compile those sources on linux for win32. It was broken some time ago and nobody fixed it because of a lack of interest.

wysota
6th March 2006, 10:19
Well, these Qt3 sources (http://qtwin.sourceforge.net/qt3-win32/index.php) compiled cleanly under Win32, using mingw-g++. Of course, that doesn't solve the initial problem of having to boot into windows, but it does mean that the same QT3/c++ code can (nearly) be compiled to run on both platforms without too many difficulties.

Wrong. This code is a port from Qt3 Unix/Free to Windows. It required heavy work to become compilable and usable and doesn't work exactly as the "original" Windows version. It's not just taken from Trolltech and compiled.

mjrich
6th March 2006, 19:58
But keep in mind that this code isn't from Trolltech.The beauty of open source :)

But it is (or better: was) possible to cross-compile those sources on linux for win32. It was broken some time ago and nobody fixed it because of a lack of interest.Now this is certainly interesting, and something I hadn't realised. Thank you Christian -- I will look at the code again if I have time, and see whether it can be resurrected.

Regards,

mjrich.