Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Compiling in debug mode fails



  • Hi,
    I'm trying to compile my project in debug mode in the Qt creator (Qt Creator 4.6.0-rc1 (4.5.83)). I'm using qmake, and this is my pro file

    TEMPLATE = app
    TARGET = ...
    CONFIG += c++17
    
    CONFIG -= gnu++17
    LIBS += -lXi -ldl -lm
    LIBS += -lX11
    LIBS += -lGL
    LIBS += -lmediainfo
    LIBS += -lglut #-lusb-1.0
    LIBS += -lGLU
    LIBS += -lpython2.7
    CONFIG -= no-pkg-config
    CONFIG += link_pkgconfig
    PKGCONFIG += opencv
    QMAKE_CXX =  g++ -std=c++1z
    QMAKE_CFLAGS = -march=native -mtune=native
    QMAKE_CXXFLAGS = -march=native -mtune=native
    QMAKE_CXXFLAGS_RELEASE -= -O
    QMAKE_CXXFLAGS_RELEASE -= -O1
    QMAKE_CXXFLAGS_RELEASE -= -O2
    QMAKE_CXXFLAGS_RELEASE *= -O3
    QMAKE_CXXFLAGS -= -std=gnu++11
    
    QT = core gui concurrent
    QT += widgets
    QT += network
    QT += opengl testlib
    QT += multimedia
    QT += multimediawidgets
    QT += charts sql
    
    
    SOURCES += \
    ....
    
    
    
    HEADERS += \
    ....
    
    includes...
    
    DISTFILES += \
        untitled.supp \
        ../../uncrustify.cfg
    
    RESOURCES += \
        ieresources.qrc
    
    libs....
    

    However, in debug mode I always get the -std=gnu++11 flag added automatically, and then c++14/17 feature don't compile. I'm using ubuntu 18.04 and gcc 7.3 (It also fails when trying to compile with clang 6).

    Any suggestions?



  • @Jonathan-Levanon

    Why are you using a release candidate (4.6.0-rc1)of creator ?

    Creator version 4.7.1 is already out. Release candidates still may have a problem.

    Also CONFIG -= gnu++17 does not remove gnu++11 if that was your intension.


  • Lifetime Qt Champion

    Hi @Jonathan-Levanon,

    Try replacing CONFIG += c++17 with CONFIG += c++1z in the pro file.



  • thanks @aha_1980 , it worked


  • Lifetime Qt Champion

    @Jonathan-Levanon So please mark this topic as SOLVED. Thanks!


Log in to reply