2012-10-24 71 views
2

首先,我是Linux操作系统的新手。在eclipse中为C++编译错误

我安装了ubuntueclipsec/c++包。

我开始了一个新的项目,这是默认的项目的“Hello World C++项目”, 当我运行它,它给了我的erorr:

Description  Resource Path Location Type 
Program "g++" not found in PATH   Preferences, C++/Build/Settings/Discovery, [CDT GCC Builtin Compiler Settings] options C/C++ Scanner Discovery Problem 

我该怎么办?

+0

任何人都知道..? – Nir

+0

我有同样的问题,你能解决吗?谢谢 ! – newprint

回答

8

尝试安装所有在控制台中键入的开发人员工具:sudo aptitude install build-essential。它将安装g ++,gcc和所有库。

+0

我得到这个错误:sudo:aptitude:command not found。我运行它在终端 – Nir

+1

也许尝试'sudo apt-get install build-essential'。这些都是类似的方案,我不知道有什么不同。 –

+0

不......不工作... – Nir

-1

我有同样的问题。以下是我如何修复它:

  1. 运行sudo sudo apt-get install build-essential安装gcc,g ++和库。
  2. 更新在/etc/environment文件中添加/usr/bin/g++
  3. 的PATH环境变量
  4. 重新启动虚拟机或PC为这个更改生效。