不久前我问过running Clang on the command line in Windows ,但无法获得任何有用的信息。现在我看到 ClangOnWin project SourceForge 提供适用于 Windows 的二进制文件。这看起来很有希望,但我从未听说过 ClangOnWin,网上似乎也没有太多提及它。我不愿意运行没有信誉的下载可执行文件。 (如果我准备在虚拟机中安装并运行它,我会的,但我不会。)
有人有使用 ClangOnWin 的经验吗?当前发行版名为 LLVM-3.5svn-win32-198200.exe,这表明它是 Clang 3.5,这很令人兴奋,因为 Clang 3.5 符合 C++14 的当前草案(根据 http://clang.llvm.org/cxx_status.html )。
最佳答案
官方 clang
Windows 版本的存在确实隐藏得很好。
来自:http://blog.llvm.org/2013/09/a-path-forward-for-llvm-toolchain-on.html
[..] We’re launching an alpha-build website as part of llvm.org where you can get fresh builds of Clang, various Clang-based-tools, LLD, and the rest of the LLVM toolchain for Windows on a regular basis. [..]
现在 "LLVM Snapshot Builds" “Windows 快照构建”页面 Ctrl+F
。有最新安装程序的链接。
现在查看下载链接的 url,我们可以发现 旧版本的安装程序可以在以下位置找到:http://llvm.org/builds/downloads/
(更新 #1)
基于在..中找到的信息:
- https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows/MSYS2
- https://wiki.archlinux.org/index.php/pacman
.. 我创建了巨大的 .7z
文件,其中包含大部分 32 位包和库。
然后发现,使用:https://sourceforge.net/projects/s-zipsfxbuilder/
.7z
存档可以转换为 .exe
(-cutable extractor)。
根本无法抗拒。
(更新 #2)
来自:https://github.com/iljau/msys2_zipped/releases/tag/v0.5
下载
msys32-setup.exe
(894 MB)。让它运行。
启动
~/msys2/mingw32_shell.bat
$ clang++ --version
clang 版本 3.4 (tags/RELEASE_34/final)
目标:i686-w64-mingw32
线程模型:posix
我得到了我的hello_world.cpp
编译。但它没有打印任何东西。 ;-D
但是这是一个好的开始。
关于c++ - ClangOnWin 是一个可靠的发行版吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21388975/