Qt on Mac (10.4)

I’ve been hanging out on the Meego IRC channel and Meego uses Qt for it’s applications, for this reason I’ve installed Qt on my mac. You can download Qt from here. I had to make one change to the source file in order to get it to compile.

[source language=”cpp”]
// #include <QtGui>
#include <QtGui/QtGui>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
return app.exec();
}[/source]

The above example is taken from the Qt Widget Tutorial with one change. The one that is commented out is the orginal line that I found doesn’t work on my mac. The new line is the one that does work.

To compile the program run the following line.
[source]g++ -framework QtGui -framework QtCore -o test test.cc[/source]
This line tells G++ to include the QtGui framework which is included at the top of the source code. In order for QtGUI to function QtCore is also required.

Leave a Reply