pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

具有完整 C++11 支持的 Windows C++ 編譯器(應該與

Windows C++ compiler with full C++11 support (should work with Qt)(具有完整 C++11 支持的 Windows C++ 編譯器(應該與 Qt 一起使用))
本文介紹了具有完整 C++11 支持的 Windows C++ 編譯器(應該與 Qt 一起使用)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

哪個 C++ 編譯器目前在 Windows 平臺上完整支持 C++11?

Which C++ compiler currently has complete C++11 support on windows platform?

Microsoft 編譯器目前沒有完整的 C++11 支持(并且不會很快添加).
MinGW g++(來自 mingw.org)不支持開箱即用的 std::thread.它也無法編譯 Qt 4 源(在構建 QtGuid4.dll 時內存不足,已知的解決方法對我不起作用).
我浪費了幾天時間嘗試在 Windows 上使用 clang,設法編譯它,但無法啟用 c++11 支持,因為它需要 libstdc++,(我認為)當時沒有移植到 windows 平臺.Qt 4 也不支持它.

Microsoft compiler currently does not have full C++11 support (and it won't be added any time soon).
MinGW g++ (from mingw.org) does not support std::thread out of the box. It also can't compile Qt 4 sources (runs out of memory while building QtGuid4.dll, known workarounds didn't work for me).
I've wasted several days trying to make clang work on windows, managed to compile it, but couldn't enable c++11 support because it required libstdc++ which (I think) wasn't ported to windows platform at that moment. It also isn't supported by Qt 4.

還有什么?我已經為 C++03 工作了很長時間,我想嘗試一下新功能,但我真的不想要一個支持不完整的工具(這會在編寫代碼時增加額外的麻煩)代碼)或在鏈接庫時內存不足(在 8GB 系統上).

What else is there? I've been working for C++03 for a long time, and I'd like to give new features a whirl, but I don't really want a tool that with incomplete support (that'll add extra headache while writing a code) or can run out of memory (on 8GB system) while linking a library.

我正在開發 64 位 Windows 7,雖然支持 64 位會很好,但我最感興趣的是 32 位應用程序,因此生成 64 位可執行文件的能力是可選的.

I'm working on windows 7 64bit, and although having 64bit support would be nice, I'm mostly interested in 32bit applications, so ability to produce 64bit executables is optional.

有什么建議嗎?

推薦答案

首先看GCC 4.8 中實驗性 C++11 支持的狀態.只有一項提案尚未正式實施.然后,看看C的實現狀態libstdc++ 中的 ++11.如您所見,有些功能尚未實現.盡管如此,我們可以說 GCC 中的 C++11 支持或多或少完整并且可用.

First of all, see Status of Experimental C++11 Support in GCC 4.8. Only one proposal is not officially implemented yet. Then, have a look at Implementation Status of C++11 in libstdc++. As you can see some features are yet to be implemented. Nevertheless, we can state that C++11 support in GCC is more or less complete and usable.

現在,關于 Windows:可能絕對是最好的原生(不是Cygwin!) GCC 的端口>,我個人認為生產質量是MinGW-w64.您可以在此處下載.當前(在撰寫本文時)最新版本基于 GCC 4.8.2.它已經支持 std::thread.更重要的是,它提供了所有可能的變化:

Now, concerning Windows: probably definitely the best native (not Cygwin!) port of GCC, which I personally consider production-quality, is MinGW-w64. You can download it here. The current (at the time of writing) latest version is based on GCC 4.8.2. It already has support for std::thread. What's more, it offers all the possible variations:

  • 64 位目標;
  • 32 位目標;
  • Win32 線程;
  • POSIX 線程;
  • SEH 例外;
  • 矮人異常;
  • SJLJ 例外.

注意:
選擇要下載的發行版時要小心:要使 std::thread 可用,您需要具有 POSIX 線程的發行版.

NOTE:
Be careful when choosing which distribution to download: for std::thread to be available, you need the one with POSIX threads.

此外,我確認我自己已經多次構建 Qt 4.8.4 和 4.8.5,甚至使用此工具鏈針對 64 位.但這還不是全部,這里列出了迄今為止我個人使用 MinGW-w64 構建的一些亮點:

Furthermore, I confirm that I've built Qt 4.8.4 and 4.8.5 myself numerous times and even targeting 64-bit with this toolchain. But that's not all, here is a list of some highlights that I've personally built with MinGW-w64 so far:

  • Boost C++ 庫;
  • Qt;
  • LLVM/Clang;
  • Google V8 JavaScript 引擎
  • ODB:C++ 對象關系映射 (ORM);
  • SQLite;
  • GLEW;
  • Vim;
  • ncurses;
  • 等等...

我認為能夠使用適用于 Windows 的舊 GCC 構建像 64 位目標這樣龐大而多樣的代碼庫是 MinGW-w64 開發團隊的奇跡般的成就.再次證明了工具鏈的質量.

I think being able to build such huge and diverse code bases as 64-bit targets with good old GCC for Windows is a miraculous achievement of MinGW-w64 developer team. It once again proves the quality of the toolchain.

我最近使用面向 x64 的 MinGW-w64 4.8.2 構建了 Qt 5.1.1.總而言之,它進行得很順利,但是在構建之前必須修補一些小問題.我已經輕輕地收集了所有需要的補丁,并使用一個簡單的批處理腳本自動完成了打補丁、構建和安裝的整個過程.如果您有興趣,請查看我的 Qt for Windows.用法非常簡單,我將跳過對其進行評論,而只是讓你們閱讀批處理腳本.請記住,您需要 Unix 的 patch.exe 來應用您可以從 MSYS 或 MSYS2 獲得的補丁(見下文).可以獲取Qt 5.1.1源代碼此處.

I've recently built Qt 5.1.1 using MinGW-w64 4.8.2 targeting x64. All in all, it went pretty smooth, but there are a few minor issues which have to be patched before the build. I've gently collected all the required patches and automated the whole process of patching, building, and installing with a simple batch script. If you are interested, check out my Qt for Windows. The usage is so simple that I'll skip commenting on it and simply let you guys read the batch script. Keep in mind that you need Unix's patch.exe to apply the patches which you could get, for example, from MSYS or MSYS2 (see below). You can obtain Qt 5.1.1 source code here.

注意:
重新發明輪子(維護 Qt 的個人構建腳本和補丁)似乎不再合理.MSYS2(見下文)現在負責一切一個>.也就是說,如果您需要使用不同的選項和/或標志重建 Qt,那么只需編輯相應的 PKGBUILD 本地文件并使用 makepkg-mingw 實用程序.

NOTE:
Does not seem reasonable to reinvent the wheel (maintaining personal build scripts and patches for Qt) anymore. MSYS2 (see below) now takes care of everything. That is if you need to rebuild Qt with different options and/or flags, then simply edit the corresponding PKGBUILD file locally and use the makepkg-mingw utility accordingly.

注意:
其實Qt項目官方推薦使用MinGW-w64和MSYS2.

這不是直接問的,但我想在這里添加它,因為這是MinGW-w64的姊妹項目,對于必須使用Unix為Windows開發本機軟件的人來說非常有用- 類似環境.

This was not asked directly, but I feel like adding it here as this is a sister project of MinGW-w64, and it's very useful for anyone who has to develop native software for Windows using Unix-like environment.

那些曾經使用過原始 MSYS 的人可能知道多少歲了.它已經很久沒有改進了,那里的所有 Unix 實用程序都已經過時了.

Those of you who have ever used the original MSYS probably know how old it is. It hasn't been improved for ages, and all the Unix utilities there are already terribly outdated.

提供 MinGW-w64 構建(如上所列)的人,現在還提供 MSYS2,您可以在此處下載>.最近,它出來了測試版,所以一定要查看最新版本.它是為 x86 和 x64 架構構建的(使用 MinGW-w64 工具鏈本身).所有實用程序都更新為最新版本.例如,您已經可以享受以下內容:Bash 4.2、Make 3.99、Git 1.8.4 等等;開箱即用,在 Windows 上本地運行!

Guys who provide builds of MinGW-w64 (listed above), now also provide builds of MSYS2 which you can download here. Recently, it came out of beta, so be sure to checkout the latest release. It's built for both x86 and x64 architectures (with the MinGW-w64 toolchain itself). All the utilities are updated to their latest versions. For instance, you can already enjoy things like: Bash 4.2, Make 3.99, Git 1.8.4, and many more; which run natively on Windows out of the box!

注意:
請務必查看他們的 Wiki 以順利開始.

NOTE:
Make sure to check their Wiki to have a smooth start.

最初的 MinGW 改進非常緩慢,其開發人員也沒有甚至考慮添加 64 位目標生成支持.由于他的公司需要在 Windows 上構建 64 位目標,一位雄心勃勃的人 Kai Tietz 接管了它并將其分叉.MinGW-w64 項目就是這樣誕生的.盡管主要目標是添加 64 位支持,但開發人員已在許多方面改進了工具鏈并解決了許多其他問題.從那時起,MinGW-w64 項目不斷發展,現在在質量方面遠遠領先于 MinGW.當MinGW-w64向MinGW提出加入房屋一起工作時,MinGW的開發者反應不足,拒絕合作.結果,今天有兩個名稱相似的項目,有時會引起混淆,但質量和支持的差異不言而喻.

The original MinGW was very slow on improvements, and its developers didn't even consider adding 64-bit target generation support. One ambitious guy, Kai Tietz, took over it and forked it as his company needed to build 64-bit targets on Windows. That's how MinGW-w64 project was born. Although the primary goal was to add 64-bit support, the developers have improved the toolchain in many aspects and addressed a great deal of other issues. Since then the MinGW-w64 project has grown and now is far ahead of MinGW in terms of quality. When MinGW-w64 proposed to MinGW to join the houses and work together, the developers of MinGW showed inadequate reaction and refused to cooperate. As a result, today there are 2 projects with similar name what sometimes causes confusion, but the differences in quality and support speak for themselves.

這篇關于具有完整 C++11 支持的 Windows C++ 編譯器(應該與 Qt 一起使用)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 ()?環形?)
主站蜘蛛池模板: 六维力传感器_三维力传感器_二维力传感器-南京神源生智能科技有限公司 | 防爆型气象站_农业气象站_校园气象站_农业四情监测系统「山东万象环境科技有限公司」 | 网带通过式抛丸机,,网带式打砂机,吊钩式,抛丸机,中山抛丸机生产厂家,江门抛丸机,佛山吊钩式,东莞抛丸机,中山市泰达自动化设备有限公司 | 比亚迪叉车-比亚迪电动叉车堆垛车托盘车仓储叉车价格多少钱报价 磁力去毛刺机_去毛刺磁力抛光机_磁力光饰机_磁力滚抛机_精密金属零件去毛刺机厂家-冠古科技 | pH污水传感器电极,溶解氧电极传感器-上海科蓝仪表科技有限公司 | 快速门厂家-快速卷帘门-工业快速门-硬质快速门-西朗门业 | 品牌广告服务平台,好排名,好流量,好生意。 | 上海刑事律师|刑事辩护律师|专业刑事犯罪辩护律师免费咨询-[尤辰荣]金牌上海刑事律师团队 | 广州企亚 - 数码直喷、白墨印花、源头厂家、透气无手感方案服务商! | AGV叉车|无人叉车|AGV智能叉车|AGV搬运车-江西丹巴赫机器人股份有限公司 | 超声波乳化机-超声波分散机|仪-超声波萃取仪-超声波均质机-精浩机械|首页 | 二手电脑回收_二手打印机回收_二手复印机回_硒鼓墨盒回收-广州益美二手电脑回收公司 | 膜结构车棚|上海膜结构车棚|上海车棚厂家|上海膜结构公司 | 深圳富泰鑫五金_五金冲压件加工_五金配件加工_精密零件加工厂 | 上海心叶港澳台联考一对一培训_上海心叶港澳台联考,港澳台联考一对一升学指导 | 切铝机-数控切割机-型材切割机-铝型材切割机-【昆山邓氏精密机械有限公司】 | 卓能JOINTLEAN端子连接器厂家-专业提供PCB接线端子|轨道式端子|重载连接器|欧式连接器等电气连接产品和服务 | 东莞螺杆空压机_永磁变频空压机_节能空压机_空压机工厂批发_深圳螺杆空压机_广州螺杆空压机_东莞空压机_空压机批发_东莞空压机工厂批发_东莞市文颖设备科技有限公司 | 缝纫客| 网站优化公司_SEO优化_北京关键词百度快速排名-智恒博网络 | 三效蒸发器_多效蒸发器价格_四效三效蒸发器厂家-青岛康景辉 | hdpe土工膜-防渗膜-复合土工膜-长丝土工布价格-厂家直销「恒阳新材料」-山东恒阳新材料有限公司 ETFE膜结构_PTFE膜结构_空间钢结构_膜结构_张拉膜_浙江萬豪空间结构集团有限公司 | 代写标书-专业代做标书-商业计划书代写「深圳卓越创兴公司」 | 塑胶跑道_学校塑胶跑道_塑胶球场_运动场材料厂家_中国塑胶跑道十大生产厂家_混合型塑胶跑道_透气型塑胶跑道-广东绿晨体育设施有限公司 | 铝箔-铝板-花纹铝板-铝型材-铝棒管-上海百亚金属材料有限公司 | 砍排机-锯骨机-冻肉切丁机-熟肉切片机-预制菜生产线一站式服务厂商 - 广州市祥九瑞盈机械设备有限公司 | NBA直播_NBA直播免费观看直播在线_NBA直播免费高清无插件在线观看-24直播网 | ★济南领跃标识制作公司★济南标识制作,标牌制作,山东标识制作,济南标牌厂 | 仿真茅草_人造茅草瓦价格_仿真茅草厂家_仿真茅草供应-深圳市科佰工贸有限公司 | 上海璟文空运首页_一级航空货运代理公司_机场快递当日达 | 不干胶标签-不干胶贴纸-不干胶标签定制-不干胶标签印刷厂-弗雷曼纸业(苏州)有限公司 | 岩棉切条机厂家_玻璃棉裁条机_水泥基保温板设备-廊坊鹏恒机械 | 北京森语科技有限公司-模型制作专家-展览展示-沙盘模型设计制作-多媒体模型软硬件开发-三维地理信息交互沙盘 | 环压强度试验机-拉链拉力试验机-上海倾技仪器仪表科技有限公司 | 深圳彩钢板_彩钢瓦_岩棉板_夹芯板_防火复合彩钢板_长鑫 | 全自动五线打端沾锡机,全自动裁线剥皮双头沾锡机,全自动尼龙扎带机-东莞市海文能机械设备有限公司 | 碳化硅,氮化硅,冰晶石,绢云母,氟化铝,白刚玉,棕刚玉,石墨,铝粉,铁粉,金属硅粉,金属铝粉,氧化铝粉,硅微粉,蓝晶石,红柱石,莫来石,粉煤灰,三聚磷酸钠,六偏磷酸钠,硫酸镁-皓泉新材料 | 东莞画册设计_logo/vi设计_品牌包装设计 - 华略品牌设计公司 | 语料库-提供经典范文,文案句子,常用文书,您的写作得力助手 | 温控器生产厂家-提供温度开关/热保护器定制与批发-惠州市华恺威电子科技有限公司 | 济南展厅设计施工_数字化展厅策划设计施工公司_山东锐尚文化传播有限公司 |