ubuntu10.04中筹建eclipse C/C++开发环境
ubuntu10.04中搭建eclipse C/C++开发环境
1.下载jre,eclipse,cdt jre: http://java.com/zh_CN/download/manual.jsp下载Linux版本下的jre文件 eclipse:www.eclipse.org cdt: www.eclipse.org/cdt/ 2.先安装eclipse: <1>在终端解压Linux下的eclipse文件 eg: sudo tar –zxvf eclipse-jee-galileo-SR1-linux-gtk.tar.gz <2> 安装jre sudo ./jre-6u22-linux-i586.bin <3>安装cdt 首先解压cdt文件 unzip cdt-master-7.0.1.zip 将cdt文件目录中plugins的内容拷贝到eclipse中 sudo cp –r cdt/plugins/ eclipse/ 将cdt文件目录中features的内容拷贝到eclipse中 sudo cp –r cdt/features/ eclipse/ 至此安装完成 下面在eclipse中新建一个C/C++程序测试一下 在新建C/C++程序之前必须确保Ubuntu中已经安装了GCC/GCC-C++编译器 ;sudo apt-get install build-essential这是安装c++编译器 接着: 在eclipse目录下双击图标:
点击File 选择new-->Project出现如下画面: 这里我已经新建了一个工程文件,所以直接使用,在工程下新建一个C/C++源文件,并编辑文件内容:输入如下测试内容:
#include<stdio.h> #include<stdlib.h> int main(){ printf("helloworld!!!"); }
编辑完成点击:eclipse上的project中的Build Project :