如何在Windows上的Eclipse中设置Clang工具链? [英] How do I setup a Clang Toolchain in Eclipse on Windows?

查看:1493
本文介绍了如何在Windows上的Eclipse中设置Clang工具链?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为一个愚蠢的问题道歉。但我在互联网上找不到答案。我在努力为64位机器上的Windows 7中设置Clang编译器/链接器/ ...。我有非常过时的C ++的知识,从来没有在Eclipse工作。我想要实现的是在Windows 7 x64机器上使用Clon在Eclipse下编译一个最简单的hello world应用程序。



我已经设法遵循< a href =http://clang.llvm.org/get_started.html =nofollow noreferrer> http://clang.llvm.org/get_started.html 获取和构建LVVM + Clang。我安装了Eclipse插件,如



虽然这更像是一个c ++ 11事情而不是ang事,但是我需要两者。


I am apologizing for a stupid question. But I could not find the answer on the Internet. I'm struggling to set up Clang compiler/linker/... for Eclipse in Windows 7 on a 64 bit machine. I have very outdated knowledge of C++ and never worked in Eclipse. What I am trying to achieve is to compile a simpliest hello world application using Clang under Eclipse on a Windows 7 x64 machine.

I've managed to follow the instruction at http://clang.llvm.org/get_started.html on getting and building LVVM + Clang. I installed the Eclipse plugin as described at http://marketplace.eclipse.org/content/llvm-toolchain-eclipse-cdt. I set the PATH environment variable to the c:\lvvm\debug\bin; that contains the built executables.

Now, how do I switch the Eclipse to use LVVM? Particularly what do I put to:

  • include directories
  • libraries
  • serarch path

in the following dialog?

Also I found the following dialog in preferences of a project:

It is completely unclear what I should make it look like.

Thank you for your help! Sorry for the nooby question, I am a C# developer trying to get back to C++.

解决方案

For what it's worth, I just had to do this today, and I found all I had to do was change

project -> properties -> c/c++ build -> settings -> tool settings -> gcc c++ compiler -> command: change it from g++ to clang++

and similarly

project -> properties -> c/c++ build -> settings -> tool settings -> gcc c compiler -> command: change it from gcc to clang

As for the indexer, I found this helped....

Eclipse CDT indexer does not know C++11 containers

Although that's more of a c++11 thing than a clang thing, but I needed both.

这篇关于如何在Windows上的Eclipse中设置Clang工具链?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆