I want to install Qt on my Mac and use the qmake through terminal to compile code. I downloaded the open source Qt Creator from Qt site, but I cannot set it up. Anyone with similar problems?
System: Mac OS X Sierra,
Qt version: 5.7.
I'm downloading the open source installer from qt.io/download-open-source . I'm installing it to Users/MyUserAccount and i want set it up so i can compile C++ code with qmake && make
Asked
Active
Viewed 1.2k times
9

georgekom
- 91
- 1
- 1
- 5
-
The problem statement is too vague, unfortunately. Please be specific: what exactly goes wrong? Any error messages? Which ones? How exactly are you trying to install QT? What version of QT? Of macOS? – ForceBru Oct 06 '16 at 20:42
-
Mac OS X Sierra, Qt 5.7. I'm downloading the open source installer from https://www.qt.io/download-open-source/ . I'm installing it to Users/MyUserAccount and i want set it up so i can compile C++ code with qmake && make – georgekom Oct 06 '16 at 20:48
-
please add this information to your question and _include a clear and extensive problem statement_: okay, you're trying to install it, what stops you from doing it? Are you getting any error messages? Please elaborate on that and incorporate it into the question. – ForceBru Oct 06 '16 at 20:51
-
No i don't have any error messages. I install it normally... I want to compile c++ code with qmake. My problem is how to work with qmake through terminal – georgekom Oct 06 '16 at 20:54
-
wait, the question is 'How to _install_ QT on Mac OS X?', which implies that you _haven't managed to install it yet_... If you'd like to work with `qmake` you should consult the documentation. – ForceBru Oct 06 '16 at 20:56
-
If you want to run `qmake` from command line, add the directory where `qmake` is located to `PATH` environment variable. How to do it depends on the shell you are using, for bash it is done by adding `export PATH=$PATH:
` to either `~/.profile`, `~/.bash_profile` or `~/.bashrc`. – Paul Oct 06 '16 at 21:01 -
THIS WORKED!!! THANK YOU – georgekom Oct 06 '16 at 21:30
3 Answers
19
Just to provide another solution using Homebrew.
As you've found QT4 isn't compatible with Mac OSX Sierra.
You can install QT5 using:
brew install qt5
But you'll find you can't access qmake from the command line. To rectify this you'll need to run:
brew link qt5 --force

elMarquis
- 7,450
- 4
- 38
- 42
-
I got an error after this: Project ERROR: Could not resolve SDK Path for 'macosx' – Snigdha Batra Aug 01 '17 at 14:37
-
@SnigdhaBatra That sounds related to the version of OSX you're on. A fix is described here. https://stackoverflow.com/questions/26320677/error-could-not-resolve-sdk-path-for-macosx10-8 – elMarquis Aug 08 '17 at 06:41
1
If you want to run qmake
from command line, add the directory where qmake
is located to PATH
environment variable. How to do it depends on the shell you are using, for bash it is done by adding export PATH=$PATH:<path_to_qmake>
to either ~/.profile
, ~/.bash_profile
or ~/.bashrc
.

Paul
- 13,042
- 3
- 41
- 59
-
I installed Qt 5.9.1 on OS X 10.13. I added `export PATH=$PATH:/Users/dspitzer/dev/Qt5.9.1/5.9.1/clang_64/bin` to my `.bashrc`, and now qmake is in my path. – Daryl Spitzer Aug 17 '18 at 00:35
0
For Installing QT4:- https://github.com/cartr/homebrew-qt4
brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt@4
For Installing QT5:-
brew install qt5

eyllanesc
- 235,170
- 19
- 170
- 241

jerinisready
- 936
- 10
- 24