久久久久久久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 ()?環形?)
主站蜘蛛池模板: 亚洲永久免费视频 | 欧美福利一区 | 一级片在线免费观看 | 亚洲高清在线播放 | 午夜国产视频 | 天堂久久久久 | 草草视频在线观看 | 久久精彩 | 亚洲精品乱码久久久久久蜜桃91 | 性免费视频 | 午夜久久久久久 | 中文字幕丰满人伦在线 | 亚洲网站在线 | 中文字幕免费看 | 成人亚洲天堂 | 免费在线黄色网址 | 欧美xxxx网站| 麻豆91在线| 国产在线日韩 | 亚洲狠狠干 | av一区二区在线观看 | 免费黄色网址在线观看 | 日韩国产一区二区 | 日韩精品久久久久 | 性巴克成人免费网站 | 欧美一级特黄视频 | 美女扒开腿让人桶爽原神 | 天天爱天天色 | 99精品成人 | 成年网站在线观看 | 五月天婷婷影院 | 久草香蕉视频 | 精品国产一区二区三区四区 | 青草视频网站 | 天天天天天干 | 国产午夜精品一区二区三区嫩草 | 欧美国产在线观看 | 免费视频国产 | 欧美激情区 | 国产一区二区中文字幕 | 国产成人在线播放 |