无法为Eclipse CDT安装LLVM工具链 [英] Unable to install LLVM toolchain for Eclipse CDT
问题描述
但是当我点击确认进行处理时与安装我得到以下错误
无法读取http://petrituononen.com/llvm4eclipsecdt/update上的存储库。
http://petrituononen.com/llvm4eclipsecdt/update不是有效的存储库位置。
此网站似乎已经不在,但我找不到任何其他来源。
有没有办法让Clang在Eclipse Mars上工作?
这是一个从对于我来说这是一个很好的工作(ubuntu 14.04 + eclipse mars + clang 3.6.2)。您可能对步骤8和9感兴趣。
-
安装Ubuntu
-
安装Java 8:
sudo apt-add-repository ppa:webupd8team / java
apt-get update
apt-get install oracle-java8-installer
-
安装g ++:
apt-get install g ++
-
安装llvm / clang 3.6.2:
http://llvm.org/releases/download.html
下载并解压缩到您选择的文件夹。我将提取的文件夹重命名为clang + llvm-3.6.2,所以在安装过程中更方便。另外我已经将它移动到/ home / [user_name] /我创建的开发文件夹。
-
将LLVM / Clang添加到PATH:
sudo gedit / etc / environment
附加路径以指向您的llvm / clang bin文件夹。
PATH =/ usr / local / sbin:/ usr / local / bin:/ usr / sbin:/ usr / bin:/ sbin:/ bin:/ usr / games:/ usr / local /games:/home/[your_user_name]/Development/clang+llvm-3.6.2/bin
您可能看起来不同,具体取决于您将您的llvm /
保存更改,重新启动。
-
安装build-essential:
sudo apt-get update
apt-get install build-essential
-
安装eclipse:
下载并提取到您选择的文件夹。 (我将其移动到我的开发文件夹,并重命名为eclipse_mars,但它是可选的)
-
安装CDT和LLVM支持:
-
在打开的Eclipse中,帮助>安装新软件使用: - 所有可用的站点 - '。
-
加载列表后,展开编程语言,安装C / C ++开发工具SDK和C / C ++ LLVM系列编译器构建支持。
-
-
配置eclipse:
-
菜单栏,选择窗口>先锋。
-
在左侧菜单中选择C / C ++> LLVM。
-
LLVM安装文件夹:,导航到您的LLVM bin文件夹
(/home/[your_user_name]/Development/clang+llvm-3.6.2/bin)
,然后单击应用并确定。 p> -
在菜单中选择文件>新建> C ++项目。 C ++项目弹出窗口打开。
-
输入项目名称,在可执行文件组
中选择项目类型,在工具链中选择使用Clang(Linux) 。点击下一步>下一步。 -
在选择配置中,点击高级设置按钮。
-
在左侧菜单中选择C / C ++ Build> Settings。
-
在工具设置选项卡中,向下滚动并选择LLVM Clang ++>方言。
将其更改为ISO C ++ 11(-std = c ++ 0x),然后单击应用按钮。 -
工具设置选项卡,向下滚动并选择LLVM Clang C ++链接器>库。
确保'Libraries(-l)'列表包含'stdc ++'。
确保库搜索路径(-L)列表包含/usr/lib/gcc/x86_64-linux-gnu/4.8 -
单击应用按钮。
-
在左侧菜单中,选择C / C ++常规>预处理器包含路径,宏等
/ li>
-
点击提供者选项卡,确保选择CDT GCC内置编译器设置[共享]。 (应该已被选中)
-
点击确定按钮。
-
点击完成按钮。
-
编译并运行您的代码。
Im trying to get Clang working again on Eclipse and therefore I've tried to install the LLVM toolchain over the Eclipse Marketplace.
But when I click Confirm to procceed with the installation I get the following error
Unable to read repository at http://petrituononen.com/llvm4eclipsecdt/update.
http://petrituononen.com/llvm4eclipsecdt/update is not a valid repository location.
This site seems to be down but I cant find any alternative sources.
Is there any way to get Clang working on Eclipse Mars ?
This is a setup from scratch that worked for me (ubuntu 14.04 + eclipse mars + clang 3.6.2). You will be probably interested in steps 8 and 9.
Install Ubuntu
Install Java 8:
sudo apt-add-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java8-installer
Install g++:
apt-get install g++
Install llvm/clang 3.6.2:
http://llvm.org/releases/download.html
Download and extract to folder of your choice. I renamed the extracted folder to 'clang+llvm-3.6.2' so it is more convenient during setup. Also I have moved it into /home/[user_name]/Development folder that I created.
Add LLVM/Clang to PATH:
sudo gedit /etc/environment
Append the path to point to your llvm/clang bin folder.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/[your_user_name]/Development/clang+llvm-3.6.2/bin"
Yours might look different, depending on where you placed your llvm/clang.
Save changes, reboot.
Install build-essential:
sudo apt-get update
apt-get install build-essential
Install eclipse:
Download and extract to a folder of your choice. (I moved it to my Development folder and renamed to eclipse_mars, but it is optional)
Install CDT and LLVM Support:
In opened Eclipse, 'Help > Install New Software > Work with: --All available sites--'.
Once the list loads, expand Programming Languages, install 'C/C++ Development Tools SDK' and 'C/C++ LLVM-Family Compiler Build Support'.
Configure eclipse:
In the top menu bar, select 'Window > Prefences'.
Select 'C/C++ > LLVM' in the left menu.
In the 'LLVM installation folder:', navigate to your LLVM bin folder (/home/[your_user_name]/Development/clang+llvm-3.6.2/bin) and click Apply and OK.
Select 'File > New > C++ Project' in the menu. C++ Project popup window opens.
Enter Project name, select Project type in the Executable group and 'LLVM with Clang(Linux)' in Toolchains. Click 'Next > Next'.
In the Select Configurations, click 'Advanced settings' button.
Select 'C/C++ Build > Settings' in the left menu.
In the 'Tool Settings' tab, scroll down and select 'LLVM Clang++ > Dialect'. Change it to 'ISO C++11 (-std=c++0x)' and click 'Apply' button.
In the 'Tool Settings' tab, scroll down and select 'LLVM Clang C++ linker > Libraries'. Make sure the 'Libraries(-l)' list contains 'stdc++'. Make sure the 'Library search path(-L) list contains '/usr/lib/gcc/x86_64-linux-gnu/4.8'
Click 'Apply' button.
In the left menu, select 'C/C++ General > Preprocessor include paths, Macros etc.'
Click 'Providers' tab and make sure 'CDT GCC Built-in Compiler Settings [Shared]' is selected. (Should be selected already).
Click 'OK' button.
Click 'Finish' button.
You should be now able to compile and run your code.
这篇关于无法为Eclipse CDT安装LLVM工具链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!