I’m the last person to praise Microsoft – with the amount of money they bleed from the human race, there is no room to give them any slack. To their credit, corporations of their magnitude almost always decay into bureaucracy and inefficiency, and they could be worse. Case in point, Visual Studio. It kicks ass. Here’s a quick rundown of what it does for me when debugging my Qt app. This is in comparison to Qt Creator, which is awesomely streamlined and elegant. But when you are debugging, every bit of comfort is gold:

  • if you set things up as i did, you can step right through the Qt source with no pain
  • the watch window takes far fewer steps to manipulate
  • the debugger can dereference pointers better
  • the debugger can dereference iterators better
  • code completion in the editor can also handle dereferenced iterators
  • debugger can show long strings much better
  • you can step over a function back up to the caller without dropping to the next line of code in the call routine (for when multiple calls take place on one line)
  • debugger doesn’t head south when often browsing out of array bounds (inevitable if you are watching variables)

I’ll add to this list as seems fit. I should probably also start a list of the advantages of Qt Creator, it is really nice to work with on linux and Mac. Including Eclipse would round out the list nicely… but for now, back to teh coding. :> Check out this recent post for instructions on getting VS set up with Qt, it’s easy.

Qt’s Phonon library has an awesome goal: abstract video and audio services to simplify cross-platform development. It has worked great for me out of the box using Qt 4.7 on linux and Mac OS X. Windows setup took a bit of elbow grease. Here are the cheatnotes to get you through it quickly.

NOTE: The Qt mingw setup worked fine for me when I was setting up my first Windows development environment, do not hesitate to go that route. All you need is the Qt SDK for Windows. Free is good!

But this time around, I opted for using Visual Studio 2010, since I already had it installed and I wanted to compare. I’ve read that there is no support for using the open-source-licensed Qt with Visual Studio, but the official Qt download page for the Visual Studio Add-In clears things up – it says the add-in “can be used for development together with all Qt licenses”. Let’s fire it up and try it out! (continued…)

UPDATE: CDB (the Qt name for the Windows debugger) sucks – no variable monitoring, etc. Useless. If you can, switch to Visual Studio to build Qt apps under windoze. See these posts instead.

The last time I set up to build my Qt apps under Windoze, I just selected the Mingw option and everything seemed to work just fine. For some reason I fell down the rabbit hole of using Visual Studio this time. I could give two craps about that, I just want it to work and get out of the way. But I had to stumble through these steps first:

  • Install Visual Studio 2010
  • Install LGPL Qt SDK for Windows
  • Also install Visual Studio Add-in from the same page
  • Add c:\Qt\4.7.1\bin to the PATH variable.
  • Build Qt from a Visual Studio prompt:
    cd C:\Qt\2010.05\qt
    rm /S /Q c:\Qt\2010.05\qt\tmp
    nmake confclean
    nmake clean
    configure -debug-and-release -opensource -shared -no-qt3support -qt-sql-sqlite -phonon -phonon-backend -webkit -platform win32-msvc2003
    nmake
  • Install Debugging Tools for Windows 32-bit Version. Only install the shit in the red circle:

    Debugging Tools options

  • Then browse here:
    C:\Program Files\Microsoft SDKs\Windows\v7.1\Redist\Debugging Tools for Windows

    and run dbg_x86.msi to install the 32-bit stuff…

  • Then run QT, select Tools->Options, and select this path in the CDB tab:
    C:\Program Files (x86)\Debugging Tools for Windows (x86)

    … what bs…

  • Write some freakin’ QT code, geesh…