久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

構建 qmake 項目時如何使用 C++14 功能?

How can I use C++14 features when building qmake projects?(構建 qmake 項目時如何使用 C++14 功能?)
本文介紹了構建 qmake 項目時如何使用 C++14 功能?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我目前在我的 Qt 應用程序中使用 C++11 功能.但是,我想在我的應用程序中使用一些新的 C++14 特性.

I'm currently using C++11 features in my Qt applications. However, I'd like to use some of the new C++14 features in my applications.

要在Qt應用程序中啟用C++11,只需在qmake項目文件中添加一行,即:

To enable C++11 in a Qt application, one only needs to add one line in the qmake project file, namely:

CONFIG += c++11

或者對于早期版本:

QMAKE_CXXFLAGS += -std=c++1y

我已經嘗試用 C++14 做同樣的事情,但是沒有用.我像這樣更改了 qmake 項目的上述行:

I already tried to do the same with C++14, but it didn't work. I changed the above mentioned line of the qmake project like this:

CONFIG += c++14

或者對于早期版本:

QMAKE_CXXFLAGS += -std=c++1y

之后,在嘗試構建項目時出現了許多以前不存在的編譯錯誤.該項目編譯正常,但是,如果我嘗試使用任何 C++14 功能,則會出現編譯錯誤.這是一個例子:

After that, lots of compilation errors, that did not exist before, appear when trying to build the project. The project compiles fine, however, if I try to use any C++14 features, I get a compilation error. This is an example:

template<typename T>
constexpr T pi = T(3.1415926535897932385);

這是相應的錯誤:

main.cpp:7: error: template declaration of 'constexpr const T pi'
constexpr T pi = T(3.1415926535897932385);  
          ^

在 QtCreator 中使用 qmake 項目時如何啟用 C++14 功能?

How to enable C++14 features when using a qmake project in QtCreator?

我使用的是 Qt 5.3.2、Qt Creator 3.2.1 和 MinGW 4.8.2 32 位.

I am using Qt 5.3.2, Qt Creator 3.2.1, and MinGW 4.8.2 32 bit.

推薦答案

Qt Creator 只是一個 IDE.

您可以將 IDE 視為更智能文本編輯器",幫助開發人員進行調試、構建、代碼完成、文件管理等.

You can think of IDEs as "smarter text editors" that aid the developer with debugging, building, code completion, file management and so on.

IDE 在編譯過程中無關緊要.

IDEs are irrelevant during compilation.

重要的是您的編譯器.獨立于您的 IDE.

g++ 4.8.x 不支持許多 C++14 功能:查看此頁面以了解支持哪些 C++14 功能.

g++ 4.8.x does not support many C++14 features: check out this page to learn what C++14 features are supported.

這篇關于構建 qmake 項目時如何使用 C++14 功能?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數據?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環: for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環?)
Reusing thread in loop c++(在循環 C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環形?)
主站蜘蛛池模板: 99精品国产在热久久 | 午夜私人影院 | 成人精品在线观看 | 亚洲国产精品99久久久久久久久 | 一级视频黄色 | 日韩欧美二区 | 欧美二区在线 | 国产精品一级 | 犬夜叉在线观看 | 狠狠天天 | 国产精品污www一区二区三区 | 四虎影院在线观看免费视频 | 天天天操天天天干 | 在线免费观看日本视频 | 人人澡视频 | 成人激情视频免费观看 | 91精品国产乱码久久久 | 中文字幕在线观看国产 | 成人久久久 | 欧美精品1区2区 | 国产a爽一区二区久久久 | 日本免费一区二区三区 | 国产精品成人一区二区 | 久久精品免费 | 精品视频久久久 | 欧美亚洲视频在线观看 | 亚洲欧美日韩精品久久亚洲区 | 国产一区二区三区在线 | 国产特黄一级 | 亚洲精品久久久久avwww潮水 | 99久久婷婷 | 一级片在线观看 | 中文字幕一区二区三区四区五区 | 婷婷免费视频 | 亚洲二区视频 | 欧美视频1 | 久久久久久综合 | 久久久久久久久久久一区二区 | 老司机久久 | 欧美人妇做爰xxxⅹ性高电影 | 欧美一级精品片在线看 |