C++ – How to compile a simple Qt and c++ application using g++ on mac os x


I am trying to use Qt for a project in school but am running into problems. I started following the tutorials and I am running into Makefile problems. Most of the tutorials say to run qmake -project, then qmake and finally make. But when I try this I run into the error make: *** No targets specified and no makefile found. Stop. I dont know much about Makefiles really. Could someone help point me in the right direction?

Best Solution

qmake on OS X creates Xcode project files. You can create a Makefile with:

qmake -spec macx-g++

If you don't want the Makefile to create an app bundle, you could also remove 'app_bundle' your configuration, for example by adding the following lines to your project file.

mac {
  CONFIG -= app_bundle