The version of MinGW used by GHC releases up to and including 7.10.1 was very old and it was troublesome to find or make Qt binaries which worked with it. GHC’s MinGW was upgraded in the 7.10.2 release and is currently much less problematic to use. However, if you are using an older GHC on Windows then see the instructions below:
The Qt project doesn’t release official 64-bit MinGW binaries, but they are available from other sources such as the Qt64 project. Specifically, the qt-5.3.1-x64-mingw482r4-sjlj-opengl build is known to work.
Unfortunately, the version of 32-bit MinGW used by the official Qt SDK is known to be incompatible with the version of MinGW which ships with current releases of GHC and the Haskell Platform. The problem typically manifests either as an error message concerning symbols missing from libstdc++6.dll, or by compiled executables crashing on start-up.
For this reason, I have produced a special build of Qt 5.3.0 for 32-bit Windows using GHC’s MinGW which can be used out of the box in place of the Qt SDK binaries. Download and unpack this zip file into the root of your
C: drive so that the
qt530-hp directory is unpacked into
C:\qt530-hp. You must use this location as the Qt installation is not relocatable. Finally, add
C:\qt530-hp\bin to your PATH variable before trying to install HsQML with Cabal.
Alternatively, it also appears to be possible to work around the problem by modifying the GHC settings file to point to the gcc executable from the copy of MinGW which ships with the Qt SDK. You may find this file located at, for example,
C:\Program Files (x86)\Haskell Platform\2013.2.0.0\lib\settings. The file consists of an associative list in Haskell Read/Show format. Modify the entry with the key “C compiler command” to point to the gcc.exe from your Qt install’s MinGW. You must rebuild HsQML after making this change.
For versions of HsQML which use Cabal 1.x, there is an issue with Cabal prior to version 1.24 which prevents the Setup script from passing the framework path to linker when building shared libraries. As a workaround, you can either build HsQML without shared libraries by using the cabal’s
--disable-shared option, or copy the Qt frameworks into your Xcode application bundle where the compiler can find them implicitly. You can find the directories on the system framework search path by running the command
clang -Xlinker -v.
Releases prior to 0.3 required Qt 4.7 or 4.8 and used the original Qt Quick 1, but this is no longer supported.
Robin KAY <email@example.com>