CGT on Windows

After reading many times the famous Qt tagline “Code once, deploy everywhere”, I expected that porting CGT to Window would be quick and painless.

It wasn’t. There were a great number of issue to make it even compile, and then some for running and installing. But I admit at least some of them were my fault:

  • CGT_EXPORT macros in public classes in libraries are not needed on Linux, but reqiured on Windows and present in virtually all libraries I looked into. Only my laziness is at fault here.
  • passing an integer to ceil() works on Linux, but not in Windows. I had to change ceil(something) to ceil(1.0 * something) globally.
  • getting application data path (AppData) is different, as there’s no cross-platform method for that in Qt.
  • Qt is comiled with “Treat WChar_t as built-in type” set to “No”, unlike the Visual Studio default. So I had to change that, and it’s not the easiest thing to find in the maze mess of configuration menus.
  • CMake targets for libraries had to be fixed to separate dll’s and lib’s.
  • cmake && make install doesn’t have permission to install into Program Files, so I had to use CPack to build an installer. That’s actually a good thing that had to be done anyway, but it’s another hurdle. It also doesn’t work right now, and I don’t know why.
  • For some reason, Qt binaries install to a location outside of PATH, so they’re not found when I try to start the program (but are found by CMake for linking).
  • You can’t link to libraries built with Visual Studio 2008 from an application built with VS 2010. And heaven forbid that told that to me, the lowly developer. No, all they told me is: The application was unable to start correctly. Go figure. It might be me (the lowly developer again, spoiled by Qt/KDE/Linux), but I haven’t the slightest clue why would the same code, only compiled with a different version of the same compiler be binary incompatible. Why can’t the .lib file, the public interface to the .dll object, be compatible?
  • I had to put up with using Windows (but that’s a subject for another post).

I suppose I could compile Qt with VS2010, and then it would work (maybe), but how’s tht for deployability? I’d like to offer this program to other people without shipping the whole 200MB of Qt libs in the package. Does it really have to be that complicated to write software?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: