Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CONFIG += is ignored?

CONFIG += is ignored?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 623 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andy Turfer
    wrote on last edited by
    #1

    I'm new to Qt and am using Qt 5.12 on Linux. I am familiarizing myself with how Qt does things. Something I've noticed it the in my MyProject.pro, the CONFIG +={values} seems to be ignore. For example, I can place this in there:

    CONFIG += AAAAAAAAA
    

    yet my project still builds without any errors.

    Why is this?

    aha_1980A 1 Reply Last reply
    0
    • A Andy Turfer

      I'm new to Qt and am using Qt 5.12 on Linux. I am familiarizing myself with how Qt does things. Something I've noticed it the in my MyProject.pro, the CONFIG +={values} seems to be ignore. For example, I can place this in there:

      CONFIG += AAAAAAAAA
      

      yet my project still builds without any errors.

      Why is this?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Andy-Turfer what happens if you place valid values there?

      Qt has to stay free or it will die.

      A 1 Reply Last reply
      0
      • aha_1980A aha_1980

        @Andy-Turfer what happens if you place valid values there?

        A Offline
        A Offline
        Andy Turfer
        wrote on last edited by
        #3

        @aha_1980 I'm not sure, which is why I have trying invalid values. CONFIG += C++11 seems to do the same thing as CONFIG += C++17. I'll try to write a small program that uses something C++17 specific.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          AFAIK, unless you have a feature corresponding to what you put in CONFIG, what you add to it won't change anything.

          See Adding New Configuration Features in Qt's documentation.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          1
          • SGaistS SGaist

            Hi and welcome to devnet,

            AFAIK, unless you have a feature corresponding to what you put in CONFIG, what you add to it won't change anything.

            See Adding New Configuration Features in Qt's documentation.

            A Offline
            A Offline
            Andy Turfer
            wrote on last edited by
            #5

            @SGaist Thanks - that seems to make sense. I just created a Qt Console application using with the following in my TestConsoleApp.pro:

            QT -= gui
            
            CONFIG += c++17 console
            CONFIG -= app_bundle
            CONFIG += JKFLDJFLKJDSKFJDS
            DEFINES += QT_DEPRECATED_WARNINGS
            
            SOURCES += \
                    main.cpp
            
            qnx: target.path = /tmp/$${TARGET}/bin
            else: unix:!android: target.path = /opt/$${TARGET}/bin
            !isEmpty(target.path): INSTALLS += target
            

            The console application uses std::string_view:

            #include <QCoreApplication>
            #include <iostream>
            #include <string_view>
            
            int main(int argc, char *argv[])
            {
                QCoreApplication a(argc, argv);
            
                std::string_view sv = "ABCD";
                std::cout << sv << std::endl;
            
                return a.exec();
            }
            

            This compiles and runs. If I change C++17 back to the default C++11, the build fails (indicating C++17 is working).

            The line with CONFIG += JKFLDJFLKJDSKFJDS does absolutely nothing.

            Thanks for the answer, I'll read through the "Adding New Configuration Features" from the docs.

            aha_1980A 1 Reply Last reply
            0
            • A Andy Turfer

              @SGaist Thanks - that seems to make sense. I just created a Qt Console application using with the following in my TestConsoleApp.pro:

              QT -= gui
              
              CONFIG += c++17 console
              CONFIG -= app_bundle
              CONFIG += JKFLDJFLKJDSKFJDS
              DEFINES += QT_DEPRECATED_WARNINGS
              
              SOURCES += \
                      main.cpp
              
              qnx: target.path = /tmp/$${TARGET}/bin
              else: unix:!android: target.path = /opt/$${TARGET}/bin
              !isEmpty(target.path): INSTALLS += target
              

              The console application uses std::string_view:

              #include <QCoreApplication>
              #include <iostream>
              #include <string_view>
              
              int main(int argc, char *argv[])
              {
                  QCoreApplication a(argc, argv);
              
                  std::string_view sv = "ABCD";
                  std::cout << sv << std::endl;
              
                  return a.exec();
              }
              

              This compiles and runs. If I change C++17 back to the default C++11, the build fails (indicating C++17 is working).

              The line with CONFIG += JKFLDJFLKJDSKFJDS does absolutely nothing.

              Thanks for the answer, I'll read through the "Adding New Configuration Features" from the docs.

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Andy-Turfer which Qt version are you using?

              It has been CONFIG+=c++1z forever. c++17 was introduced as alias in 5.12, IIRC.

              Qt has to stay free or it will die.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved