After spending all day developing closed source commercial software for .NET, I decided I had an hour or so to spare, so thought I might attempt to do some open source work.
I have very little spare time in which I have energy and can concentrate well enough to get work done, so my priority was to get set up so I could compile my own code as soon as possible.
I’ve been trying for years to find the time to resume development on some Qt apps I wrote years ago. I now work in Windows and don’t have a suitable Linux system for GUI development, so decided to try developing for Qt in Windows.
The first thing I needed to do was to set up a development environment. I browsed to ftp.trolltech.com and into /qt/source. There, I found qt-win-opensource-4.3.0rc1.zip and assumed this would be a good version to try.
I downloaded and unpacked the ZIP and, as there didn’t appear to be any kind of hand-holding application to run, proceeded to scan the README. Here’s an excerpt:
For this release, the following platforms have been tested:
win32-g++
win32-icc (commercial edition only)
win32-msvc (commercial edition only)
win32-msvc.net (commercial edition only)
win32-msvc2005 (commercial edition only
This appeared to be saying that I wouldn’t be able to build Qt without g++ for Windows. I really didn’t want to have to use g++, as that would mean finding it, downloading it, installing it, probably setting environment variables; and, I guessed, having nightmares getting code to link and run properly. I’d much rather use Visual Studio 2005.
Why have Trolltech made it difficult for me to get Qt up and running on Windows? I’m intending to do non-commercial development, so why try to force me to buy the commercial edition? There’s absolutely no way I could afford it, so unless there is a way to work around this, my open source applications will never get ported to Windows.
Surely the more open source applications for Qt/Windows the better? More publicity (at no cost to Trolltech) is good, isn’t it?
I had an idea: I searched the web for ‘win32-msvc2005’. This led me to the KDE-Cygwin project, where I found that some clever folks had patched Qt to build on Windows with Visual Studio. They’d also made various patches to the source. I’m not sure what all those patches do, but I was happy enough to get Qt compiling. My free time is limited and the faster I can start developing, the more likely it is that I’ll come up with something useful.
I tried the patch but found it didn’t apply properly as it needed an earlier version of Qt, so I downloaded that, unpacked, patched and ran configure.bat. This failed because it couldn’t find nmake, so I found the Visual Studio command prompt and tried configure.bat again. This time it got further, but then failed with a strange error:
error C2244: 'QMultiHash<Key,T>::replace' : unable to match
function definition to an existing declaration
This error wasn’t one I recognised (or could understand quickly) so I tried a web search for ‘qmultihash replace unable to match function’. This brought me to one of Microsoft’s forums, where people were complaining that they couldn’t compile Qt since installing SP1 for Visual Studio 2005. At this point my heart sank, as if there was no fix for this, I wasn’t going to get any development done today.
One of the Visual C++ Compiler team said on the forum:
The ‘fix’ that caused this change in behavior has been backed out of SP1 and I have confirmed that the (almost) final Visual C++ 2005 SP1 compiler can compile this code.
This puzzled me, as I was running the final SP1. If they backed out the ‘fix’ which caused the breakage, why was I seeing it? Six days later, there was a post from another member of the compiler team, saying:
[...] recent logistical issues have caused the fix (for Qt) to not make SP1.
At this point, I was starting to despair, but I found later in the forum thread that there was rumour of a ‘hotfix’ from Microsoft. Sadly, it sounded like I would have to call tech support to get it - an experience described by one forum member as being like ‘trying to drive a car from the north pole to the south pole’. Again, I sensed my open source development time slipping away.
When I found the hotfix page on Microsoft’s support site, it turned out that it was indeed possible to download the fix. Fantastic!
The hotfix downloaded slowly through Microsoft’s download manager application, insisted on extracting itself to a directory, then I got to run an installer. This then sat doing nothing for a while before asking if I wanted to apply the hotfix. After answering in the affirmative and accepting the license agreement (which I didn’t read), it paused for several more minutes before showing progres.
I wrote the text of this document up to here while waiting for the download and install of this hotfix. It’s still installing and has been saying ‘Time remaining: 0 seconds’ for a couple of minutes now. It’s time for me to give up, as I really need my beauty sleep.
Statistics thus far:
Time spent: 1 hour.
Development complete: none.