1.Ubuntu下安装Eclipse,JDK 见 http://www.linuxidc.com/Linux/2011-01/31367.htm
2.安装CDT插件,此外sudo apt-get install build-essential(安装的是GCC工具链,Make等一系列开发工具)
3.启动eclipse后,经过 Windows–>Preferences–>C/C++–>Build–>Environment增加Environment variables to set
及点Add添加:
Name: C_INCLUDE_PATH
Value: /usr/include
和
Name: CPLUS_INCLUDE_PATH
Value: /usr/include/c++/4.6.1(gcc –version)
4.运行C++程序,编写好C++程序后,点击Project->build Project编译C++程序,然后运行即可。