Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 872
Sam Avatar asked Jan 13 '09 22:01

Sam


People also ask

How do I run a CPP program on a Mac?

To run a program in C++ in Mac we have to install Xcode or command-line tools for Xcode. Ways: Hence, there are two options to run a C++ program on Mac. Download and install by using Command Line Tools and using any preferred IDE or Code Editor for writing C or C++ code.

What is QML Mac?

QML is a user interface specification and programming language. It allows developers and designers alike to create highly performant, fluidly animated and visually appealing applications.


1 Answers

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
}
like image 100
danieldk Avatar answered Sep 28 '22 10:09

danieldk