适用于 Windows 的 LLVM C++ IDE
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2487931/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
LLVM C++ IDE for Windows
提问by osgx
Is there some C/C++ IDE for Windows, which is integratedwith the LLVM compiler (and Clang C/C++ analyzer), just like modern Xcode do.
是否有一些适用于 Windows 的 C/C++ IDE,它与 LLVM 编译器(和 Clang C/C++ 分析器)集成在一起,就像现代 Xcode 一样。
I have Dev-Cpp (it uses outdated GCC) and Code::Blocks(with some GCC). But GCC gives me very cryptic error messages. I want to get some more user-friendly error messages from the Clang frontend.
我有 Dev-Cpp(它使用过时的 GCC)和Code::Blocks(带有一些 GCC)。但是 GCC 给了我非常神秘的错误信息。我想从 Clang 前端获得一些对用户更友好的错误消息。
Yes, Clang was not able to be used with complex C++ code, but trunk Clang already can compile LLVM itself. So I wonder if is there any of LLVM IDEs in development or in beta versions.
是的,Clang 不能与复杂的 C++ 代码一起使用,但是主干 Clang 已经可以自己编译 LLVM。所以我想知道是否有任何 LLVM IDE 处于开发或测试版中。
Yes, I can use Clang as other compiler with GCC-compatible IDEs. But is there any IDE, that are integratedwith Clang? Clang have a different output format, so the IDE must parse it. Clang can provide IDE parsing of sources. Clang has an analyze option, which must be supported in an IDE. Take a look, e.g http://iosdevelopertips.com/xcode/static-code-analysis-clang-and-xcode-3-2.html
是的,我可以将 Clang 用作具有 GCC 兼容 IDE 的其他编译器。但是有没有与 Clang集成的IDE ?Clang 具有不同的输出格式,因此 IDE 必须对其进行解析。Clang 可以提供源代码的 IDE 解析。Clang 有一个分析选项,IDE 必须支持该选项。看一看,例如http://iosdevelopertips.com/xcode/static-code-analysis-clang-and-xcode-3-2.html
And the most wanted feature of Clang - is smart auto-completion, so the IDE can suggest only syntaxilly-correct variants, e.g. list only fields of this struct, class.
Clang 最需要的功能是智能自动完成,因此 IDE 只能建议语法正确的变体,例如仅列出此结构、类的字段。
Results:(merged from answers):
结果:(从答案合并):
- Eclipse with CDT>=8 and with https://code.google.com/archive/p/llvm4eclipsecdt/plugin, from Petri Tuononen (no smart auto-completion)
- Vim with vimrc from the LLVM project (smart completion only?) https://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/
- Emacs with (smart completion only?) https://llvm.org/svn/llvm-project/cfe/trunk/utils/clang-completion-mode.el
- Qt Creator: https://blog.qt.io/blog/2011/10/19/qt-creator-and-clang/
- CodeLite: http://www.codelite.org/LiteEditor/ClangIntegration35
- 带有 CDT>=8 和https://code.google.com/archive/p/llvm4eclipsecdt/插件的Eclipse ,来自 Petri Tuononen(无智能自动完成)
- 来自 LLVM 项目的带有 vimrc 的 Vim(仅智能完成?)https://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/
- 带有(仅智能完成?)https://llvm.org/svn/llvm-project/cfe/trunk/utils/clang-completion-mode.el 的Emacs
- Qt Creator:https: //blog.qt.io/blog/2011/10/19/qt-creator-and-clang/
- CodeLite:http: //www.codelite.org/LiteEditor/ClangIntegration35
采纳答案by Petri Tuononen
LLVM is supported in Eclipse CDTvia plug-in (llvm4eclipsecdt). It is the only Windows supported IDE supporting LLVMas far as I know. I am the main author of the plug-in so you can ask any questions related to it.
Eclipse CDT通过插件 ( llvm4eclipsecdt)支持 LLVM 。据我所知,它是唯一支持 LLVM 的 Windows 支持的 IDE。我是插件的主要作者,所以你可以提出任何与它相关的问题。
The plug-in offers the basic functionality for Clang and llvm-gcc compilation and support Linux and Windows (w/ Cygwin & MiNGW). LLVM tools such as assembler, archiver, linker, and static compiler (llc) are configured and can be customized via UI. The plug-in offers all the benefits that IDE can offer such as easy configuration and building with one action.
该插件提供 Clang 和 llvm-gcc 编译的基本功能,并支持 Linux 和 Windows(带 Cygwin 和 MiNGW)。LLVM 工具如汇编器、归档器、链接器和静态编译器 (llc) 已配置并可通过 UI 进行定制。该插件提供了 IDE 可以提供的所有好处,例如简单的配置和一个操作即可构建。
The only drawback is that it is not ready yet as it lacks of some of the advanced features that LLVM can offer such as Clang analyze and smart auto-completion. The plug-in is also not tested well and may not work perfectly therefore I hope I can get user feedback via mailing list found from Google code development site (listed below). I wish I had time to develop it further. I only develop it in my spare time, which is very limited. I welcome any developers to participate and contribute to the project.
唯一的缺点是它还没有准备好,因为它缺乏 LLVM 可以提供的一些高级功能,例如 Clang 分析和智能自动完成。该插件也没有经过很好的测试,可能无法完美运行,因此我希望我可以通过从 Google 代码开发站点(如下所列)找到的邮件列表获得用户反馈。我希望我有时间进一步开发它。我只是在业余时间开发它,这是非常有限的。我欢迎任何开发人员参与并为该项目做出贡献。
Development site:http://code.google.com/p/llvm4eclipsecdt/
https://github.com/TuononenP/llvm4eclipsecdt
开发地点:http://code.google.com/p/llvm4eclipsecdt/
https://github.com/TuononenP/llvm4eclipsecdt
Eclipse marketplace (100% free & open-source):http://marketplace.eclipse.org/content/llvm-toolchain-eclipse-cdt
Eclipse 市场(100% 免费和开源):http://marketplace.eclipse.org/content/llvm-toolchain-eclipse-cdt
UPDATE: The plugin is deprecated. Instead install "C/C++ LLVM-Family Compiler Build Support" under Programming Languages using the official Eclipse update site e.g. http://download.eclipse.org/releases/mars
更新:该插件已弃用。而是使用官方 Eclipse 更新站点(例如http://download.eclipse.org/releases/mars)在编程语言下安装“C/C++ LLVM-Family Compiler Build Support”
回答by ohmantics
LLVM contributor Dan Gohman recently added Clang code completion to vim.
LLVM 贡献者 Dan Gohman 最近在vim 中添加了 Clang 代码完成功能。
http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/vimrcis intended for use in developing LLVM itself and helps with the LLVM coding style, but the code completion portion should be easy enough to extract.
http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/vimrc旨在用于开发 LLVM 本身并有助于 LLVM 编码风格,但代码完成部分应该很容易提取.
Yeah, yeah, vim isn't an IDE, but it may be useful to know about.
是的,是的,vim 不是 IDE,但了解它可能很有用。
[edit] https://llvm.org/svn/llvm-project/cfe/trunk/utils/clang-completion-mode.elprovides a similar option for emacs.
[编辑] https://llvm.org/svn/llvm-project/cfe/trunk/utils/clang-completion-mode.el为emacs提供了类似的选项。
回答by Kokizzu
Qt Creatorworks also with Clang...
Qt Creator也适用于 Clang...
回答by relaxxx
回答by Paul Fultz II
There isn't one for windows. But if you want smart auto-completion, netbeans has one of the best code completions for C++. It parses macros, generic containers, and smart pointers. Plus it provides refactoring, code insertion of constructors and getters and setters. It works really well. However, since it still uses a separate parser for C++, it doesn't catch as many errors as the compiler does.
没有窗户的。但是如果你想要智能自动完成,netbeans 有最好的 C++ 代码完成之一。它解析宏、通用容器和智能指针。此外,它还提供重构、构造函数、getter 和 setter 的代码插入。它真的很好用。但是,由于它仍然使用单独的 C++ 解析器,因此它捕获的错误不如编译器多。
Netbeans for java is integrated in with the compiler, so it gives errors and warnings as you type, as well as syntactically correct code completion. So, netbeans will very likely in the future integrate with clang to provide the same kind of features for C++.
Netbeans for java 与编译器集成在一起,因此它会在您键入时提供错误和警告,以及语法正确的代码完成。因此,将来 netbeans 很可能会与 clang 集成,为 C++ 提供相同类型的功能。
回答by Leo Hippel?inen
LLVM support has been added to Eclipse: http://marketplace.eclipse.org/node/28778
LLVM 支持已添加到Eclipse:http: //marketplace.eclipse.org/node/28778
回答by Micha? Wróbel
Also, CodeLite has Clang backend for smart code completion. See Using clang code-completion with CodeLite.
此外,CodeLite 具有用于智能代码完成的 Clang 后端。请参阅将 clang 代码完成与 CodeLite 结合使用。
CodeLite is available for Windows, however, I haven't tested it under Windows yet.
CodeLite 可用于 Windows,但是,我还没有在 Windows 下测试它。
回答by Hindol
May I add SublimeText 2? It already has a plugin SublimeClangthat supports clang based smart code-completion.
我可以添加 SublimeText 2 吗?它已经有一个插件SublimeClang,支持基于 clang 的智能代码完成。
回答by Pawe? Bylica
LLVM provides Windows snapshot builds- a clang toolset for Visual Studio as Windows installer. Currently it should integrate with Visual Studio 2010, 2012 and 2013. More information can be found on LLVM's blog post A path forward for an LLVM toolchain on Windows.
LLVM 提供Windows 快照构建- 作为 Windows 安装程序的 Visual Studio 的 clang 工具集。目前它应该与 Visual Studio 2010、2012 和 2013 集成。更多信息可以在 LLVM 的博客文章A path forward for an LLVM toolchain on Windows 中找到。
回答by kfunk
KDevelopfor Windows is another option. While still in early stages there (you currently need to set up the environment to be able to use MSVC/MinGW compilers yourself), it's usable and brings the awesome code comprehension of the IDE to Windows.
KDevelopfor Windows 是另一种选择。虽然仍处于早期阶段(您目前需要设置环境才能自己使用 MSVC/MinGW 编译器),但它是可用的,并将 IDE 的出色代码理解带到 Windows。