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

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

Windows C++ compiler with full C++11 support (should work with Qt)(具有完整 C++11 支持的 Windows C++ 編譯器(應(yīng)該與 Qt 一起使用))
本文介紹了具有完整 C++11 支持的 Windows C++ 編譯器(應(yīng)該與 Qt 一起使用)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

哪個(gè) C++ 編譯器目前在 Windows 平臺(tái)上完整支持 C++11?

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

Microsoft 編譯器目前沒(méi)有完整的 C++11 支持(并且不會(huì)很快添加).
MinGW g++(來(lái)自 mingw.org)不支持開(kāi)箱即用的 std::thread.它也無(wú)法編譯 Qt 4 源(在構(gòu)建 QtGuid4.dll 時(shí)內(nèi)存不足,已知的解決方法對(duì)我不起作用).
我浪費(fèi)了幾天時(shí)間嘗試在 Windows 上使用 clang,設(shè)法編譯它,但無(wú)法啟用 c++11 支持,因?yàn)樗枰?libstdc++,(我認(rèn)為)當(dāng)時(shí)沒(méi)有移植到 windows 平臺(tái).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.

還有什么?我已經(jīng)為 C++03 工作了很長(zhǎng)時(shí)間,我想嘗試一下新功能,但我真的不想要一個(gè)支持不完整的工具(這會(huì)在編寫(xiě)代碼時(shí)增加額外的麻煩)代碼)或在鏈接庫(kù)時(shí)內(nèi)存不足(在 8GB 系統(tǒng)上).

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.

我正在開(kāi)發(fā) 64 位 Windows 7,雖然支持 64 位會(huì)很好,但我最感興趣的是 32 位應(yīng)用程序,因此生成 64 位可執(zhí)行文件的能力是可選的.

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 中實(shí)驗(yàn)性 C++11 支持的狀態(tài).只有一項(xiàng)提案尚未正式實(shí)施.然后,看看C的實(shí)現(xiàn)狀態(tài)libstdc++ 中的 ++11.如您所見(jiàn),有些功能尚未實(shí)現(xiàn).盡管如此,我們可以說(shuō) 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.

現(xiàn)在,關(guān)于 Windows:可能絕對(duì)是最好的原生(不是Cygwin!) GCC 的端口>,我個(gè)人認(rèn)為生產(chǎn)質(zhì)量是MinGW-w64.您可以在此處下載.當(dāng)前(在撰寫(xiě)本文時(shí))最新版本基于 GCC 4.8.2.它已經(jīng)支持 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 位目標(biāo);
  • 32 位目標(biāo);
  • Win32 線(xiàn)程;
  • POSIX 線(xiàn)程;
  • SEH 例外;
  • 矮人異常;
  • SJLJ 例外.

注意:
選擇要下載的發(fā)行版時(shí)要小心:要使 std::thread 可用,您需要具有 POSIX 線(xiàn)程的發(fā)行版.

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

此外,我確認(rèn)我自己已經(jīng)多次構(gòu)建 Qt 4.8.4 和 4.8.5,甚至使用此工具鏈針對(duì) 64 位.但這還不是全部,這里列出了迄今為止我個(gè)人使用 MinGW-w64 構(gòu)建的一些亮點(diǎn):

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++ 庫(kù);
  • Qt;
  • LLVM/Clang;
  • Google V8 JavaScript 引擎
  • ODB:C++ 對(duì)象關(guān)系映射 (ORM);
  • SQLite;
  • GLEW;
  • Vim;
  • ncurses;
  • 等等...

我認(rèn)為能夠使用適用于 Windows 的舊 GCC 構(gòu)建像 64 位目標(biāo)這樣龐大而多樣的代碼庫(kù)是 MinGW-w64 開(kāi)發(fā)團(tuán)隊(duì)的奇跡般的成就.再次證明了工具鏈的質(zhì)量.

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 構(gòu)建了 Qt 5.1.1.總而言之,它進(jìn)行得很順利,但是在構(gòu)建之前必須修補(bǔ)一些小問(wèn)題.我已經(jīng)輕輕地收集了所有需要的補(bǔ)丁,并使用一個(gè)簡(jiǎn)單的批處理腳本自動(dòng)完成了打補(bǔ)丁、構(gòu)建和安裝的整個(gè)過(guò)程.如果您有興趣,請(qǐng)查看我的 Qt for Windows.用法非常簡(jiǎn)單,我將跳過(guò)對(duì)其進(jìn)行評(píng)論,而只是讓你們閱讀批處理腳本.請(qǐng)記住,您需要 Unix 的 patch.exe 來(lái)應(yīng)用您可以從 MSYS 或 MSYS2 獲得的補(bǔ)丁(見(jiàn)下文).可以獲取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.

注意:
重新發(fā)明輪子(維護(hù) Qt 的個(gè)人構(gòu)建腳本和補(bǔ)丁)似乎不再合理.MSYS2(見(jiàn)下文)現(xiàn)在負(fù)責(zé)一切一個(gè)>.也就是說(shuō),如果您需要使用不同的選項(xiàng)和/或標(biāo)志重建 Qt,那么只需編輯相應(yīng)的 PKGBUILD 本地文件并使用 makepkg-mingw 實(shí)用程序.

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.

注意:
其實(shí)Qt項(xiàng)目官方推薦使用MinGW-w64和MSYS2.

這不是直接問(wèn)的,但我想在這里添加它,因?yàn)檫@是MinGW-w64的姊妹項(xiàng)目,對(duì)于必須使用Unix為Windows開(kāi)發(fā)本機(jī)軟件的人來(lái)說(shuō)非常有用- 類(lèi)似環(huán)境.

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.

那些曾經(jīng)使用過(guò)原始 MSYS 的人可能知道多少歲了.它已經(jīng)很久沒(méi)有改進(jìn)了,那里的所有 Unix 實(shí)用程序都已經(jīng)過(guò)時(shí)了.

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 構(gòu)建(如上所列)的人,現(xiàn)在還提供 MSYS2,您可以在此處下載>.最近,它出來(lái)了測(cè)試版,所以一定要查看最新版本.它是為 x86 和 x64 架構(gòu)構(gòu)建的(使用 MinGW-w64 工具鏈本身).所有實(shí)用程序都更新為最新版本.例如,您已經(jīng)可以享受以下內(nèi)容:Bash 4.2、Make 3.99、Git 1.8.4 等等;開(kāi)箱即用,在 Windows 上本地運(yùn)行!

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!

注意:
請(qǐng)務(wù)必查看他們的 Wiki 以順利開(kāi)始.

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

最初的 MinGW 改進(jìn)非常緩慢,其開(kāi)發(fā)人員也沒(méi)有甚至考慮添加 64 位目標(biāo)生成支持.由于他的公司需要在 Windows 上構(gòu)建 64 位目標(biāo),一位雄心勃勃的人 Kai Tietz 接管了它并將其分叉.MinGW-w64 項(xiàng)目就是這樣誕生的.盡管主要目標(biāo)是添加 64 位支持,但開(kāi)發(fā)人員已在許多方面改進(jìn)了工具鏈并解決了許多其他問(wèn)題.從那時(shí)起,MinGW-w64 項(xiàng)目不斷發(fā)展,現(xiàn)在在質(zhì)量方面遠(yuǎn)遠(yuǎn)領(lǐng)先于 MinGW.當(dāng)MinGW-w64向MinGW提出加入房屋一起工作時(shí),MinGW的開(kāi)發(fā)者反應(yīng)不足,拒絕合作.結(jié)果,今天有兩個(gè)名稱(chēng)相似的項(xiàng)目,有時(shí)會(huì)引起混淆,但質(zhì)量和支持的差異不言而喻.

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.

這篇關(guān)于具有完整 C++11 支持的 Windows C++ 編譯器(應(yīng)該與 Qt 一起使用)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數(shù)據(jù)?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫(xiě) for() 循環(huán): for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環(huán)?)
Reusing thread in loop c++(在循環(huán) C++ 中重用線(xiàn)程)
Precise thread sleep needed. Max 1ms error(需要精確的線(xiàn)程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環(huán)形?)
主站蜘蛛池模板: 成人av在线播放 | 久久精品二区亚洲w码 | 国产精品观看 | 九七午夜剧场福利写真 | 亚洲精品视频在线播放 | 精品久久久久久久久久久久久久久久久 | 99re在线播放 | 激情网站| 久久新| 97国产一区二区 | 久久黄色精品视频 | 久草久草久草 | 日韩精品一区二区三区在线观看 | 国产精品久久久久久婷婷天堂 | 久久久久九九九九 | 99精品视频在线观看免费播放 | 国产精品视频导航 | 国产精品高潮呻吟久久 | 中文字幕 国产 | 羞羞视频网| 亚洲精品二区 | 国产96色在线 | 三级视频在线观看电影 | 久热免费在线 | 看片网站在线 | 亚洲一在线 | 在线免费看黄 | 国产免费一区二区三区免费视频 | 日韩欧美国产精品综合嫩v 一区中文字幕 | 欧美一区2区三区3区公司 | 久草网址| 99re热精品视频 | 欧美一区二区在线看 | 日本精品一区二区三区视频 | 精品国产不卡一区二区三区 | 色婷婷久久久亚洲一区二区三区 | 精品九九九 | 亚洲天堂av一区 | 亚洲视频三 | 欧美精选一区二区 | 午夜爱爱毛片xxxx视频免费看 |