Qt and Boost (installed through Homebrew) result in Qt compile errors
Solved
General and Desktop
-
I am in the exact situation described in this question (http://stackoverflow.com/questions/23134937/qt-creator-on-mac-and-boost-libraries) but the accepted answer is not working for me. I've searched around and tried all the suggestions I've found but I still end up with errors
Environment:
- OSX 10.9.5
- Qt 5.5.1 - Qt Creator 3.5.1 - installed using the Qt
installer - Boost 1.59.0 – installed through Homebrew
- Am able to compile and run Qt apps
After creating a new Qt test application, when I add the
Boost
information to the .pro file (shown below) as described in the question linked above, I end up with very confusing compile errors within the Qt classes. I don't get it. Does anyone understand the conflict and know how to resolve this – I've been at it for hours now.QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = audiowaveform_test TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui macx { QMAKE_CXXFLAGS += -std=c++11 _BOOST_PATH = /usr/local/Cellar/boost/1.59.0 INCLUDEPATH += "$${_BOOST_PATH}/include/" LIBS += -L$${_BOOST_PATH}/lib ## Use only one of these: LIBS += -lboost_chrono-mt -lboost_system # using dynamic lib (not sure if you need that "-mt" at the end or not) #LIBS += $${_BOOST_PATH}/lib/libboost_chrono-mt.a # using static lib }
-
Hi,
Use
CONFIG += c++11
to activate C++11 properly, there's the standard you want to use as well as linking to the correct library.