Nominate our 2022 Qt Champions!

Qt and Boost (installed through Homebrew) result in Qt compile errors

  • I am in the exact situation described in this question ( 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


    • OSX 10.9.5
    • Qt 5.5.1 - Qt Creator 3.5.1 - installed using the Qt
    • 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.

    enter image description here

    QT   += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = audiowaveform_test
    TEMPLATE = app
    SOURCES += main.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

  • Lifetime Qt Champion


    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.

  • @SGaist

    heh – I must be receiving your comments telepathically – I just "discovered" that a few minutes before seeing your comment.


Log in to reply