Monday, May 18, 2009

Mac OS X Leopard and QT 4.5-hello.cpp

Install QT Creator on your machine.

Put this code in a file called hello.cpp

#include
#include
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}

run these commands to make the project and Makefiles respectively
/usr/bin/qmake-4.5 -project
/usr/bin/qmake-4.5

$ ls
Info.plist Makefile hello.app hello.cpp hello.o hello.pro hello.xcodeproj

Open the directory in the finder and clock on the xcodeproj file.

This will invoke QT Creator and open the project file.

Select

Build->BuildALL
Build->Run