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. QMAKE_CXXFLAGS += -fpermissive -std=C++11 in .pro file generate compile error
Forum Updated to NodeBB v4.3 + New Features

QMAKE_CXXFLAGS += -fpermissive -std=C++11 in .pro file generate compile error

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 6.5k Views 1 Watching
  • 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
    andsun
    wrote on 12 Feb 2015, 10:32 last edited by
    #1

    Hi guys,

    I'm running Qt 5.2 to create an application, within it I want to us c++11 features.
    but when adding "QMAKE_CXXFLAGS += -fpermissive -std=C++11"
    to my .pro file and compile I receive errors that the -std=C++11 part is not recogniced
    ":-1: error: error: unrecognized command line option '-std=C++11'"

    any suggestions??

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andsun
      wrote on 12 Feb 2015, 10:33 last edited by
      #2

      .pro as it looks
      QMAKE_CFLAGS = -fpermissive
      QMAKE_CXXFLAGS += -fpermissive
      -std=C++11
      QMAKE_LFLAGS = -fpermissive

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 12 Feb 2015, 10:59 last edited by
        #3

        Hi,

        use
        @CONFIG += c++11@
        The correct flags will be added for you.

        Beware when you do something like
        @
        QMAKE_CFLAGS = -fpermissive
        @
        You are clearing the content of QMAKE_CFLAGS

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

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andsun
          wrote on 12 Feb 2015, 11:42 last edited by
          #4

          Hi SGaist,

          thks for reply, tried CONFIG += c++11.
          looks like it works however now generating huge amount of errors from the old C-code created prior to 1994 and included as nested includes.
          Errors like :
          error: 'boolean' does not name a type

          Shall try "extern "C" { } around the include's

          Thanks for the warning on QMAKE_CFLAGS, look it up ;)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 12 Feb 2015, 23:55 last edited by
            #5

            It's valid for any variable, right now it seems that you wiped CONFIG or is it a typo ?

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

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andsun
              wrote on 13 Feb 2015, 07:55 last edited by
              #6

              Hi, fixed the problem caused by unnecessary included .h file. found and removed it. mission accomplished.

              How do you mean wiped CONFIG?
              @CONFIG = C++11@
              or
              @CONFIG += C++11 @

              They would set or add to CONFIG, as I understand it.
              Do you mean at the ... = -fpermissive parts?

              I'm trying to read the QMake && Qt -manuals and understand config but don't see (unless I might be blind ) any suggestion there about this/why usage.

              I had problem with vtable error and found the -fpermissive solution on the web, don't know why but it works ;) hence no worries and keep on coding.

              [edit: added missing coding tags @ SGaist]

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 14 Feb 2015, 00:45 last edited by
                #7

                The vtable error generally arises when you add/remove the Q_OBJECT macro and don't run qmake before building

                Most Qt defined variable you'll modify using either += or *= unless you have good reasons to empty its value first.

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

                1 Reply Last reply
                0

                1/7

                12 Feb 2015, 10:32

                • Login

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