macOS - Qt Creator & Boost
Jul 16, 2015
Installing brew/Qt5/Qt Creator/boost
-
Install Homebrew brew.sh
-
Update brew
brew update
- Install qt5 and boost
brew install qt5 brew install boost
-
Install Qt Creator https://www.qt.io/download-open-source/
- Inside Qt Creator Qt Creator -> Preferences -> Build & Run -> Qt Versions -> Add
5a. Select “Macintosh HD”
5b. Command + Shift + .
5c. /usr/local/Cellar/qt5/<version>/bin/qmake
- Select “Kits” -> Add
6a. Compiler -> Clang (x86 64bit)
6b. Qt version -> <version you added in step 5>
- OK
Setting up boost in a Qt project
-
Edit <project name>.pro
-
Append to the end ``` CONFIG += c++11 QMAKE_CFLAGS += -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.8 QMAKE_CXXFLAGS += -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.8
LIBS += -L”/usr/local/Cellar/boost/1.55.0_2/lib” INCLUDEPATH += “/usr/local/Cellar/boost/1.55.0_2/include” ```
- Add your boost libs to “LIBS” like so:
LIBS += -L"/usr/local/Cellar/boost/1.55.0_2/lib" -lboost_random