How to enable C++11 in Qt Creator?











up vote
147
down vote

favorite
33












The title is pretty self-descriptive. I've downloaded Qt Creator 2.7.0, and I am trying to compile some basic C++11 code:



int my_array[5] = {1, 2, 3, 4, 5};
for(int &x : my_array)
{
x *= 2;
}


I'm receiving the following error:



range based for loops are not allowed in c++ 98 mode


Yet, according to this article this version of Qt Creator supports C++11. So how do I enable it?










share|improve this question




















  • 3




    Qt Creator is not a compiler. When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.
    – cmannett85
    Jun 5 '13 at 20:55










  • @cmannett85 Qt Creator still does not use Clang as a C++ syntax parser. There were efforts, but Clang's API and general performance of this solution delayed this. Current work in this direction is located here.
    – rubenvb
    Jan 4 '14 at 17:14















up vote
147
down vote

favorite
33












The title is pretty self-descriptive. I've downloaded Qt Creator 2.7.0, and I am trying to compile some basic C++11 code:



int my_array[5] = {1, 2, 3, 4, 5};
for(int &x : my_array)
{
x *= 2;
}


I'm receiving the following error:



range based for loops are not allowed in c++ 98 mode


Yet, according to this article this version of Qt Creator supports C++11. So how do I enable it?










share|improve this question




















  • 3




    Qt Creator is not a compiler. When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.
    – cmannett85
    Jun 5 '13 at 20:55










  • @cmannett85 Qt Creator still does not use Clang as a C++ syntax parser. There were efforts, but Clang's API and general performance of this solution delayed this. Current work in this direction is located here.
    – rubenvb
    Jan 4 '14 at 17:14













up vote
147
down vote

favorite
33









up vote
147
down vote

favorite
33






33





The title is pretty self-descriptive. I've downloaded Qt Creator 2.7.0, and I am trying to compile some basic C++11 code:



int my_array[5] = {1, 2, 3, 4, 5};
for(int &x : my_array)
{
x *= 2;
}


I'm receiving the following error:



range based for loops are not allowed in c++ 98 mode


Yet, according to this article this version of Qt Creator supports C++11. So how do I enable it?










share|improve this question















The title is pretty self-descriptive. I've downloaded Qt Creator 2.7.0, and I am trying to compile some basic C++11 code:



int my_array[5] = {1, 2, 3, 4, 5};
for(int &x : my_array)
{
x *= 2;
}


I'm receiving the following error:



range based for loops are not allowed in c++ 98 mode


Yet, according to this article this version of Qt Creator supports C++11. So how do I enable it?







c++ qt c++11






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 9 '15 at 9:20









Ali

37.3k16131214




37.3k16131214










asked Jun 5 '13 at 19:37









Andrey Chernukha

12.7k1370138




12.7k1370138








  • 3




    Qt Creator is not a compiler. When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.
    – cmannett85
    Jun 5 '13 at 20:55










  • @cmannett85 Qt Creator still does not use Clang as a C++ syntax parser. There were efforts, but Clang's API and general performance of this solution delayed this. Current work in this direction is located here.
    – rubenvb
    Jan 4 '14 at 17:14














  • 3




    Qt Creator is not a compiler. When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.
    – cmannett85
    Jun 5 '13 at 20:55










  • @cmannett85 Qt Creator still does not use Clang as a C++ syntax parser. There were efforts, but Clang's API and general performance of this solution delayed this. Current work in this direction is located here.
    – rubenvb
    Jan 4 '14 at 17:14








3




3




Qt Creator is not a compiler. When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.
– cmannett85
Jun 5 '13 at 20:55




Qt Creator is not a compiler. When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.
– cmannett85
Jun 5 '13 at 20:55












@cmannett85 Qt Creator still does not use Clang as a C++ syntax parser. There were efforts, but Clang's API and general performance of this solution delayed this. Current work in this direction is located here.
– rubenvb
Jan 4 '14 at 17:14




@cmannett85 Qt Creator still does not use Clang as a C++ syntax parser. There were efforts, but Clang's API and general performance of this solution delayed this. Current work in this direction is located here.
– rubenvb
Jan 4 '14 at 17:14












6 Answers
6






active

oldest

votes

















up vote
241
down vote



accepted










According to this site add



CONFIG += c++11



to your .pro file (see at the bottom of that web page). It requires Qt 5.





The other answers, suggesting



QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x)



also work with Qt 4.8 and gcc / clang.






share|improve this answer



















  • 4




    Anonymous downvotes aren't helping anybody. What's wrong with the answer?
    – Ali
    Aug 11 '14 at 20:58










  • The problem was, I wasn't able to delete your duplicate/incomplete answer, all I could do was to downvote it. Now that you have edited it to make it more presentable, I am happy with just the downvote.
    – nurettin
    Aug 21 '14 at 12:55








  • 8




    @nurettin Thanks for the feedback. If you examine carefully the edit histories of the answers (mine and the others), you will see that my original answer was not a duplicate; it was actually the other answer that shamelessly stole part of my answer, making my answer look like a duplicate. Then two more duplicate answers appeared this year. Check it for yourself in the edit histories. Given this information, would you reconsider your downvote?
    – Ali
    Aug 21 '14 at 15:23






  • 3




    @Troyseph Here is my understanding of the situation. I am assuming that you are using gcc. If a version of gcc supports -std=c++11, then it should also support (the deprecated) -std=c++0x flag as well, and both flags are supposed to have identical effects (which apparently isn't the case on your machine). If a compiler supports -std=c++0x, it doesn't mean that it understands -std=c++11. Therefore, picking -std=c++0x as default for C++11 compatibility mode is a reasonable choice. On my machine, at least according to the man page, -std=c++0x and -std=c++11 are identical.
    – Ali
    Sep 15 '15 at 10:38






  • 1




    @Troyseph Now, it is true that it would be better to use -std=c++11 if the compiler supports it, and Qt could be smart enough to do so. Well, if this issue hurts you that much, you could file a bug report...
    – Ali
    Sep 15 '15 at 10:42


















up vote
30
down vote













Add this to your .pro file



QMAKE_CXXFLAGS += -std=c++11


or



CONFIG += c++11





share|improve this answer






























    up vote
    16
    down vote













    As an alternative for handling both cases addressed in Ali's excellent answer, I usually add



    # With C++11 support
    greaterThan(QT_MAJOR_VERSION, 4){
    CONFIG += c++11
    } else {
    QMAKE_CXXFLAGS += -std=c++0x
    }


    to my project files. This can be handy when you don't really care much about which Qt version is people using in your team, but you want them to have C++11 enabled in any case.






    share|improve this answer





















    • This should be -std=c++11
      – Predrag Manojlovic
      Nov 18 '16 at 13:53




















    up vote
    6
    down vote













    add to your qmake file



    QMAKE_CXXFLAGS+= -std=c++11
    QMAKE_LFLAGS += -std=c++11





    share|improve this answer




























      up vote
      3
      down vote













      If you are using an earlier version of QT (<5) try this



      QMAKE_CXXFLAGS += -std=c++0x





      share|improve this answer




























        up vote
        0
        down vote













        The only place I have successfully make it work is by searching in:




        ...Qt{5.9; or your version}mingw{53_32; or your
        version}mkspecswin32-g++qmake.conf:




        Then at the line:



        QMAKE_CFLAGS           += -fno-keep-inline-dllexport


        Edit :



        QMAKE_CFLAGS           += -fno-keep-inline-dllexport -std=c++11





        share|improve this answer























          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16948382%2fhow-to-enable-c11-in-qt-creator%23new-answer', 'question_page');
          }
          );

          Post as a guest
































          6 Answers
          6






          active

          oldest

          votes








          6 Answers
          6






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          241
          down vote



          accepted










          According to this site add



          CONFIG += c++11



          to your .pro file (see at the bottom of that web page). It requires Qt 5.





          The other answers, suggesting



          QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x)



          also work with Qt 4.8 and gcc / clang.






          share|improve this answer



















          • 4




            Anonymous downvotes aren't helping anybody. What's wrong with the answer?
            – Ali
            Aug 11 '14 at 20:58










          • The problem was, I wasn't able to delete your duplicate/incomplete answer, all I could do was to downvote it. Now that you have edited it to make it more presentable, I am happy with just the downvote.
            – nurettin
            Aug 21 '14 at 12:55








          • 8




            @nurettin Thanks for the feedback. If you examine carefully the edit histories of the answers (mine and the others), you will see that my original answer was not a duplicate; it was actually the other answer that shamelessly stole part of my answer, making my answer look like a duplicate. Then two more duplicate answers appeared this year. Check it for yourself in the edit histories. Given this information, would you reconsider your downvote?
            – Ali
            Aug 21 '14 at 15:23






          • 3




            @Troyseph Here is my understanding of the situation. I am assuming that you are using gcc. If a version of gcc supports -std=c++11, then it should also support (the deprecated) -std=c++0x flag as well, and both flags are supposed to have identical effects (which apparently isn't the case on your machine). If a compiler supports -std=c++0x, it doesn't mean that it understands -std=c++11. Therefore, picking -std=c++0x as default for C++11 compatibility mode is a reasonable choice. On my machine, at least according to the man page, -std=c++0x and -std=c++11 are identical.
            – Ali
            Sep 15 '15 at 10:38






          • 1




            @Troyseph Now, it is true that it would be better to use -std=c++11 if the compiler supports it, and Qt could be smart enough to do so. Well, if this issue hurts you that much, you could file a bug report...
            – Ali
            Sep 15 '15 at 10:42















          up vote
          241
          down vote



          accepted










          According to this site add



          CONFIG += c++11



          to your .pro file (see at the bottom of that web page). It requires Qt 5.





          The other answers, suggesting



          QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x)



          also work with Qt 4.8 and gcc / clang.






          share|improve this answer



















          • 4




            Anonymous downvotes aren't helping anybody. What's wrong with the answer?
            – Ali
            Aug 11 '14 at 20:58










          • The problem was, I wasn't able to delete your duplicate/incomplete answer, all I could do was to downvote it. Now that you have edited it to make it more presentable, I am happy with just the downvote.
            – nurettin
            Aug 21 '14 at 12:55








          • 8




            @nurettin Thanks for the feedback. If you examine carefully the edit histories of the answers (mine and the others), you will see that my original answer was not a duplicate; it was actually the other answer that shamelessly stole part of my answer, making my answer look like a duplicate. Then two more duplicate answers appeared this year. Check it for yourself in the edit histories. Given this information, would you reconsider your downvote?
            – Ali
            Aug 21 '14 at 15:23






          • 3




            @Troyseph Here is my understanding of the situation. I am assuming that you are using gcc. If a version of gcc supports -std=c++11, then it should also support (the deprecated) -std=c++0x flag as well, and both flags are supposed to have identical effects (which apparently isn't the case on your machine). If a compiler supports -std=c++0x, it doesn't mean that it understands -std=c++11. Therefore, picking -std=c++0x as default for C++11 compatibility mode is a reasonable choice. On my machine, at least according to the man page, -std=c++0x and -std=c++11 are identical.
            – Ali
            Sep 15 '15 at 10:38






          • 1




            @Troyseph Now, it is true that it would be better to use -std=c++11 if the compiler supports it, and Qt could be smart enough to do so. Well, if this issue hurts you that much, you could file a bug report...
            – Ali
            Sep 15 '15 at 10:42













          up vote
          241
          down vote



          accepted







          up vote
          241
          down vote



          accepted






          According to this site add



          CONFIG += c++11



          to your .pro file (see at the bottom of that web page). It requires Qt 5.





          The other answers, suggesting



          QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x)



          also work with Qt 4.8 and gcc / clang.






          share|improve this answer














          According to this site add



          CONFIG += c++11



          to your .pro file (see at the bottom of that web page). It requires Qt 5.





          The other answers, suggesting



          QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x)



          also work with Qt 4.8 and gcc / clang.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 11 '14 at 20:58

























          answered Jun 5 '13 at 21:18









          Ali

          37.3k16131214




          37.3k16131214








          • 4




            Anonymous downvotes aren't helping anybody. What's wrong with the answer?
            – Ali
            Aug 11 '14 at 20:58










          • The problem was, I wasn't able to delete your duplicate/incomplete answer, all I could do was to downvote it. Now that you have edited it to make it more presentable, I am happy with just the downvote.
            – nurettin
            Aug 21 '14 at 12:55








          • 8




            @nurettin Thanks for the feedback. If you examine carefully the edit histories of the answers (mine and the others), you will see that my original answer was not a duplicate; it was actually the other answer that shamelessly stole part of my answer, making my answer look like a duplicate. Then two more duplicate answers appeared this year. Check it for yourself in the edit histories. Given this information, would you reconsider your downvote?
            – Ali
            Aug 21 '14 at 15:23






          • 3




            @Troyseph Here is my understanding of the situation. I am assuming that you are using gcc. If a version of gcc supports -std=c++11, then it should also support (the deprecated) -std=c++0x flag as well, and both flags are supposed to have identical effects (which apparently isn't the case on your machine). If a compiler supports -std=c++0x, it doesn't mean that it understands -std=c++11. Therefore, picking -std=c++0x as default for C++11 compatibility mode is a reasonable choice. On my machine, at least according to the man page, -std=c++0x and -std=c++11 are identical.
            – Ali
            Sep 15 '15 at 10:38






          • 1




            @Troyseph Now, it is true that it would be better to use -std=c++11 if the compiler supports it, and Qt could be smart enough to do so. Well, if this issue hurts you that much, you could file a bug report...
            – Ali
            Sep 15 '15 at 10:42














          • 4




            Anonymous downvotes aren't helping anybody. What's wrong with the answer?
            – Ali
            Aug 11 '14 at 20:58










          • The problem was, I wasn't able to delete your duplicate/incomplete answer, all I could do was to downvote it. Now that you have edited it to make it more presentable, I am happy with just the downvote.
            – nurettin
            Aug 21 '14 at 12:55








          • 8




            @nurettin Thanks for the feedback. If you examine carefully the edit histories of the answers (mine and the others), you will see that my original answer was not a duplicate; it was actually the other answer that shamelessly stole part of my answer, making my answer look like a duplicate. Then two more duplicate answers appeared this year. Check it for yourself in the edit histories. Given this information, would you reconsider your downvote?
            – Ali
            Aug 21 '14 at 15:23






          • 3




            @Troyseph Here is my understanding of the situation. I am assuming that you are using gcc. If a version of gcc supports -std=c++11, then it should also support (the deprecated) -std=c++0x flag as well, and both flags are supposed to have identical effects (which apparently isn't the case on your machine). If a compiler supports -std=c++0x, it doesn't mean that it understands -std=c++11. Therefore, picking -std=c++0x as default for C++11 compatibility mode is a reasonable choice. On my machine, at least according to the man page, -std=c++0x and -std=c++11 are identical.
            – Ali
            Sep 15 '15 at 10:38






          • 1




            @Troyseph Now, it is true that it would be better to use -std=c++11 if the compiler supports it, and Qt could be smart enough to do so. Well, if this issue hurts you that much, you could file a bug report...
            – Ali
            Sep 15 '15 at 10:42








          4




          4




          Anonymous downvotes aren't helping anybody. What's wrong with the answer?
          – Ali
          Aug 11 '14 at 20:58




          Anonymous downvotes aren't helping anybody. What's wrong with the answer?
          – Ali
          Aug 11 '14 at 20:58












          The problem was, I wasn't able to delete your duplicate/incomplete answer, all I could do was to downvote it. Now that you have edited it to make it more presentable, I am happy with just the downvote.
          – nurettin
          Aug 21 '14 at 12:55






          The problem was, I wasn't able to delete your duplicate/incomplete answer, all I could do was to downvote it. Now that you have edited it to make it more presentable, I am happy with just the downvote.
          – nurettin
          Aug 21 '14 at 12:55






          8




          8




          @nurettin Thanks for the feedback. If you examine carefully the edit histories of the answers (mine and the others), you will see that my original answer was not a duplicate; it was actually the other answer that shamelessly stole part of my answer, making my answer look like a duplicate. Then two more duplicate answers appeared this year. Check it for yourself in the edit histories. Given this information, would you reconsider your downvote?
          – Ali
          Aug 21 '14 at 15:23




          @nurettin Thanks for the feedback. If you examine carefully the edit histories of the answers (mine and the others), you will see that my original answer was not a duplicate; it was actually the other answer that shamelessly stole part of my answer, making my answer look like a duplicate. Then two more duplicate answers appeared this year. Check it for yourself in the edit histories. Given this information, would you reconsider your downvote?
          – Ali
          Aug 21 '14 at 15:23




          3




          3




          @Troyseph Here is my understanding of the situation. I am assuming that you are using gcc. If a version of gcc supports -std=c++11, then it should also support (the deprecated) -std=c++0x flag as well, and both flags are supposed to have identical effects (which apparently isn't the case on your machine). If a compiler supports -std=c++0x, it doesn't mean that it understands -std=c++11. Therefore, picking -std=c++0x as default for C++11 compatibility mode is a reasonable choice. On my machine, at least according to the man page, -std=c++0x and -std=c++11 are identical.
          – Ali
          Sep 15 '15 at 10:38




          @Troyseph Here is my understanding of the situation. I am assuming that you are using gcc. If a version of gcc supports -std=c++11, then it should also support (the deprecated) -std=c++0x flag as well, and both flags are supposed to have identical effects (which apparently isn't the case on your machine). If a compiler supports -std=c++0x, it doesn't mean that it understands -std=c++11. Therefore, picking -std=c++0x as default for C++11 compatibility mode is a reasonable choice. On my machine, at least according to the man page, -std=c++0x and -std=c++11 are identical.
          – Ali
          Sep 15 '15 at 10:38




          1




          1




          @Troyseph Now, it is true that it would be better to use -std=c++11 if the compiler supports it, and Qt could be smart enough to do so. Well, if this issue hurts you that much, you could file a bug report...
          – Ali
          Sep 15 '15 at 10:42




          @Troyseph Now, it is true that it would be better to use -std=c++11 if the compiler supports it, and Qt could be smart enough to do so. Well, if this issue hurts you that much, you could file a bug report...
          – Ali
          Sep 15 '15 at 10:42












          up vote
          30
          down vote













          Add this to your .pro file



          QMAKE_CXXFLAGS += -std=c++11


          or



          CONFIG += c++11





          share|improve this answer



























            up vote
            30
            down vote













            Add this to your .pro file



            QMAKE_CXXFLAGS += -std=c++11


            or



            CONFIG += c++11





            share|improve this answer

























              up vote
              30
              down vote










              up vote
              30
              down vote









              Add this to your .pro file



              QMAKE_CXXFLAGS += -std=c++11


              or



              CONFIG += c++11





              share|improve this answer














              Add this to your .pro file



              QMAKE_CXXFLAGS += -std=c++11


              or



              CONFIG += c++11






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 4 '14 at 17:08









              Guilherme Nascimento

              5,03752781




              5,03752781










              answered Jun 5 '13 at 19:42









              Sherlock

              908816




              908816






















                  up vote
                  16
                  down vote













                  As an alternative for handling both cases addressed in Ali's excellent answer, I usually add



                  # With C++11 support
                  greaterThan(QT_MAJOR_VERSION, 4){
                  CONFIG += c++11
                  } else {
                  QMAKE_CXXFLAGS += -std=c++0x
                  }


                  to my project files. This can be handy when you don't really care much about which Qt version is people using in your team, but you want them to have C++11 enabled in any case.






                  share|improve this answer





















                  • This should be -std=c++11
                    – Predrag Manojlovic
                    Nov 18 '16 at 13:53

















                  up vote
                  16
                  down vote













                  As an alternative for handling both cases addressed in Ali's excellent answer, I usually add



                  # With C++11 support
                  greaterThan(QT_MAJOR_VERSION, 4){
                  CONFIG += c++11
                  } else {
                  QMAKE_CXXFLAGS += -std=c++0x
                  }


                  to my project files. This can be handy when you don't really care much about which Qt version is people using in your team, but you want them to have C++11 enabled in any case.






                  share|improve this answer





















                  • This should be -std=c++11
                    – Predrag Manojlovic
                    Nov 18 '16 at 13:53















                  up vote
                  16
                  down vote










                  up vote
                  16
                  down vote









                  As an alternative for handling both cases addressed in Ali's excellent answer, I usually add



                  # With C++11 support
                  greaterThan(QT_MAJOR_VERSION, 4){
                  CONFIG += c++11
                  } else {
                  QMAKE_CXXFLAGS += -std=c++0x
                  }


                  to my project files. This can be handy when you don't really care much about which Qt version is people using in your team, but you want them to have C++11 enabled in any case.






                  share|improve this answer












                  As an alternative for handling both cases addressed in Ali's excellent answer, I usually add



                  # With C++11 support
                  greaterThan(QT_MAJOR_VERSION, 4){
                  CONFIG += c++11
                  } else {
                  QMAKE_CXXFLAGS += -std=c++0x
                  }


                  to my project files. This can be handy when you don't really care much about which Qt version is people using in your team, but you want them to have C++11 enabled in any case.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 15 '15 at 15:41









                  Яois

                  2,83631941




                  2,83631941












                  • This should be -std=c++11
                    – Predrag Manojlovic
                    Nov 18 '16 at 13:53




















                  • This should be -std=c++11
                    – Predrag Manojlovic
                    Nov 18 '16 at 13:53


















                  This should be -std=c++11
                  – Predrag Manojlovic
                  Nov 18 '16 at 13:53






                  This should be -std=c++11
                  – Predrag Manojlovic
                  Nov 18 '16 at 13:53












                  up vote
                  6
                  down vote













                  add to your qmake file



                  QMAKE_CXXFLAGS+= -std=c++11
                  QMAKE_LFLAGS += -std=c++11





                  share|improve this answer

























                    up vote
                    6
                    down vote













                    add to your qmake file



                    QMAKE_CXXFLAGS+= -std=c++11
                    QMAKE_LFLAGS += -std=c++11





                    share|improve this answer























                      up vote
                      6
                      down vote










                      up vote
                      6
                      down vote









                      add to your qmake file



                      QMAKE_CXXFLAGS+= -std=c++11
                      QMAKE_LFLAGS += -std=c++11





                      share|improve this answer












                      add to your qmake file



                      QMAKE_CXXFLAGS+= -std=c++11
                      QMAKE_LFLAGS += -std=c++11






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Mar 14 '14 at 19:59









                      guardezi

                      12617




                      12617






















                          up vote
                          3
                          down vote













                          If you are using an earlier version of QT (<5) try this



                          QMAKE_CXXFLAGS += -std=c++0x





                          share|improve this answer

























                            up vote
                            3
                            down vote













                            If you are using an earlier version of QT (<5) try this



                            QMAKE_CXXFLAGS += -std=c++0x





                            share|improve this answer























                              up vote
                              3
                              down vote










                              up vote
                              3
                              down vote









                              If you are using an earlier version of QT (<5) try this



                              QMAKE_CXXFLAGS += -std=c++0x





                              share|improve this answer












                              If you are using an earlier version of QT (<5) try this



                              QMAKE_CXXFLAGS += -std=c++0x






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 10 '14 at 15:19









                              asloob

                              1,0701831




                              1,0701831






















                                  up vote
                                  0
                                  down vote













                                  The only place I have successfully make it work is by searching in:




                                  ...Qt{5.9; or your version}mingw{53_32; or your
                                  version}mkspecswin32-g++qmake.conf:




                                  Then at the line:



                                  QMAKE_CFLAGS           += -fno-keep-inline-dllexport


                                  Edit :



                                  QMAKE_CFLAGS           += -fno-keep-inline-dllexport -std=c++11





                                  share|improve this answer



























                                    up vote
                                    0
                                    down vote













                                    The only place I have successfully make it work is by searching in:




                                    ...Qt{5.9; or your version}mingw{53_32; or your
                                    version}mkspecswin32-g++qmake.conf:




                                    Then at the line:



                                    QMAKE_CFLAGS           += -fno-keep-inline-dllexport


                                    Edit :



                                    QMAKE_CFLAGS           += -fno-keep-inline-dllexport -std=c++11





                                    share|improve this answer

























                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote









                                      The only place I have successfully make it work is by searching in:




                                      ...Qt{5.9; or your version}mingw{53_32; or your
                                      version}mkspecswin32-g++qmake.conf:




                                      Then at the line:



                                      QMAKE_CFLAGS           += -fno-keep-inline-dllexport


                                      Edit :



                                      QMAKE_CFLAGS           += -fno-keep-inline-dllexport -std=c++11





                                      share|improve this answer














                                      The only place I have successfully make it work is by searching in:




                                      ...Qt{5.9; or your version}mingw{53_32; or your
                                      version}mkspecswin32-g++qmake.conf:




                                      Then at the line:



                                      QMAKE_CFLAGS           += -fno-keep-inline-dllexport


                                      Edit :



                                      QMAKE_CFLAGS           += -fno-keep-inline-dllexport -std=c++11






                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited 2 days ago









                                      tymion albaj

                                      174




                                      174










                                      answered Jun 8 '17 at 2:18









                                      Bretzelus

                                      734




                                      734






























                                           

                                          draft saved


                                          draft discarded



















































                                           


                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16948382%2fhow-to-enable-c11-in-qt-creator%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest




















































































                                          Popular posts from this blog

                                          Florida Star v. B. J. F.

                                          Danny Elfman

                                          Lugert, Oklahoma