Posts Tagged ‘Visual Studio’

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?


KDevelop vs VisualStudio for Qt/C++

Since I’m writing a multiplayer card game system in Qt, I’d like to make sure for it to be as cross-platform as possible. That’s why I signed up for MSDN Academic Alliance via the university, which gave me free access to Windows and Visual Studio.

This gives me an opportunity to compare VS against my current favourite, KDevelop. It is fitting that both projects are currently in a beta stage and both future releases promise great improvements. I’ll try to be objective, but my only experience is with a CMake-Qt C++ project, which certainly isn’t VS’s focus

In ease of installation, KDevelop wins hands down. Even not using the linux standard {one-line|three-click} package install, compiling KDevelop from source takes less time and effort than downloading and installing VS.

Continue reading