Qt/Windows and Cygwin

Posted by George Wright Mon, 21 Jan 2008 21:22:00 GMT

So in the process of learning about cygwin/mingw/qt in order to port qtnx to Windows, I concluded that the easiest way would be to compile nxcl using cygwin (which, luckily, compiled with no changes at all), and then to compile Qt inside cygwin and then compile qtnx inside cygwin, linking to both Qt and nxcl.

Turns out getting Qt 4 to compile inside cygwin is a non-trivial task. Thankfully, however, the LyX guys have done most of the work. It just needed a minor alteration to the source, though, otherwise a linker error occurred during compilation of Qt/Win 4.3.3.

In src/corelib/codecs/qtextcodec.cpp, there is an #ifdef block starting on line 528. You just need to add

&& !defined(Q_CYGWIN_WIN)

to stop the Asian codecs from being compiled in; there’s probably a better solution to this, but I don’t see this as being particularly problematic. After that you can follow the instructions in the LyX wiki and link to Qt just fine.

From this you can probably tell that I now have QtNX compiling inside cygwin on Windows. Well, yes, it works, but I haven’t yet tested whether it will actually connect to any servers. Theoretically, it should so long as I set the PATH properly to point to the directory where nxssh and nxproxy are, and hopefully all should just work fine! I may need to append “.exe” to the binary names in nxcl though, but all in all I think it should be fairly trivial from now on (so long as nxproxy behaves as expected and doesn’t start making annoying noises about X11 and Win32).


Gratuitous QtNX on Windows screenshot

Posted in ,  | 6 comments

Comments

  1. vokimon said about 4 hours later:

    Congratulations for such a success. I supose you need cygwin because the Posix layer. For our project, CLAM, mingw was a better option. We managed to build all the windows stuff crosscompiling from Linux and running most things, including Gtk, Qt and NSIS installers for windows, with wine. This way we could generate even the installers without using Windows at all. Well, the had to use it to test whether the final installers worked on a real Windows ;-)

  2. ethana2 said about 6 hours later:

    “Well, the had to use it to test whether the final installers worked on a real Windows ;-)”

    …WINE? ^_^

  3. Tim said about 17 hours later:

    I just use MSVC. It’s very easy to compile Qt4 with it.

  4. Nord said about 24 hours later:

    Jesus George, things have come a long way since harrow—im impressed

  5. Thomas said about 1 month later:

    I’ve tried to follow the “LyX on Cygwin” build intruction. Unfortunately the configure stopped with the error message:

    header (master) created for Qt3Support headers.pri file created for Qt3Support mkdir /cygdrive/c/User/src/qtwin-4.3.3/build-cygwin/src/tools mkdir /cygdrive/c/User/src/qtwin-4.3.3/build-cygwin/src/tools/uic Creating qmake. Please wait… C:\cygwin\bin\make.exe: * No rule to make target generators/makefile.cpp', needed bymakefile.o’. Stop.

    Can you please help?

  6. Thomas said about 1 month later:

    Sorry for spoiling your page with my entries. The reason for that above was a different version of make. Cygwin is comming with V3.81, I used V3.80 to avoid another problem. Make always reported “multiple target patterns”, see http://list.coin-or.org/pipermail/ipopt/2006-July/000612.html. That’s live in the open source world.

    I’ve now the problem with two undefined externals:

    C:\User\bin/libQtCore.a(qbytearray.o):qbytearray.cpp:(.text+0xdb6): undefined reference to _uncompress' C:\User\bin/libQtCore.a(qbytearray.o):qbytearray.cpp:(.text+0x11a3): undefined reference to_compress2’

    I linked against libz. It doesn’t eigther.

    Thank you.

(leave url/email »)

   Comment Markup Help Preview comment