在Ubuntu的Eclipse Juno CDT中,程序“g++没有在路径中找到”。

时间:2023-01-13 11:27:40

Eclipse June CDT reports g++ not found in path, how to fix this?

Eclipse June CDT报告g++在path中没有找到,如何修复它?

5 个解决方案

#1


9  

Typically, g++ will be installed when gcc (GNU Compiler Collection) is installed. First confirm that you have g++ installed.

通常,在安装gcc (GNU编译器集合)时将安装g++。首先确认已经安装了g++。

You can check this by typing the following in a terminal: which g++. The response ought to be /usr/bin/g++.

您可以通过在终端输入以下内容来检查这个:哪个g++。响应应该是/usr/bin/g++。

If you find g++ installed, in eclipse go to project->properties->C/C++ Build->Discovery Options, under tools GCC C++ Compiler, put the exact path to g++ instead of g++ (if g++ alone does not work).

如果你在eclipse中发现了g++的安装,那么在eclipse中,>的属性-> - C/ c++构建->的发现选项,在工具GCC c++编译器下,将正确的路径改为g++而不是g++(如果g+单独不工作)。

You will find this link useful: What is the difference between g++ and gcc?

你会发现这个链接很有用:g++和gcc的区别是什么?

If you still have problems, do get back with feedback.

如果你还有问题,一定要及时反馈。

#2


9  

I had similar problem and it is solved by

我遇到了类似的问题,解决了。

  1. Installing g++ The GNU C++ complier using ubuntu software centre and

    使用ubuntu软件中心安装g++的GNU c++编译器。

  2. Changing in -

    改变,

    Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build in Complier Settings [Shared]

    窗口->首选项-> C/ c++ ->构建->设置->发现-> CDT GCC在编译器设置中构建[共享]

    From: ${COMMAND} -E -P -v -dD "${INPUTS}"

    从:${命令}-E -P -v -dD“${input}”

    To: /usr/bin/${COMMAND} -E -P -v -dD "${INPUTS}"

    To: /usr/bin/${命令}-E -P -v -dD“${input}”

I hope it helps. I think if you add it to the project as mentioned in the first answer, you will need to add all the time for new projects. And if you add as I wrote you don't need to add it for new projects.

我希望它有帮助。我认为,如果您将其添加到第一个答案中提到的项目中,您将需要为新项目添加所有时间。如果你加上我写的,你不需要把它添加到新项目中。

#3


1  

I have exactly the same problem. I never had problems with eclipse before under linux and now it wont even compile code. I tried to change the name of the g++ and gcc compilers to their exact location in project->properties->c/c++ Build->discovery options etc. nothing helped, I tried to reinstall eclipse and did an initialize, added the path to the variables etc.. Nothing worked so fare. The project I am working on is quiet big and I rather would like eclipse to manage the source and makefile, instead of doing it manually

我也有同样的问题。在linux下,我从来没有遇到过eclipse的问题,现在它甚至不会编译代码。我尝试将g++和gcc编译器的名称改为project->属性->属性-> - c/c++构建->发现选项等等,没有任何帮助,我尝试重新安装eclipse并进行了初始化,增加了变量的路径等。没有工作。我正在开发的项目是非常安静的,我宁愿使用eclipse来管理源文件和makefile,而不是手工操作。

Linux Mint 15 Eclispe: Version: 3.8.1 (I tried it with the latest version as well ... nothing changed)

Linux Mint 15 Eclispe:版本:3.8.1(我试用了最新版本……)没有改变)

g++ --version g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++——版本g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3版权(C) 2012免费软件基金会,这是免费软件;查看复制条件的源代码。没有保证;即使是对适销性或适合某一特定用途。

gcc --version gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc——版本gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3版权(C) 2012免费软件基金会,这是免费软件;查看复制条件的源代码。没有保证;即使是对适销性或适合某一特定用途。

example:

例子:

#include // not resolved using namespace std;

int main() {
    std::cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}

Well the code above is not what bothers me, as I can fix it by adding the includes of the exact c++ include path, but the code just wont compile. Wired enough eclipse gives me the error:

上面的代码并不是困扰我的问题,因为我可以通过添加正确的c++ include路径来修复它,但是代码不会编译。连线到足够的eclipse给我错误:

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

描述资源路径位置类型程序“g++”没有在路径首选项,c++ /构建/设置/发现,[CDT GCC Builtin编译器设置]选项C/ c++扫描仪发现问题。

but it appears to me to be possible to compile single files, by opening them and pressing crt+b, but the whole project wont compile.

但是在我看来,通过打开和压缩crt+b来编译单个文件是可能的,但是整个项目不会编译。

Fixed the problem this morning:
- got the latest eclipse
- created a new workspace
- created a new project

修正了今天早上的问题:-获得了最新的eclipse -创建了一个新的工作空间-创建了一个新的项目。

after a few seconds the very same error disappears

几秒钟后,同样的错误消失了。

#4


1  

This issue was fixed for me once I deleted eclipse's .metedata folder, called eclipse -initialize from the command line and started eclipse again. HTH

当我删除eclipse的.metedata文件夹时,这个问题就被修复了,它被称为eclipse -初始化命令行,并再次启动eclipse。HTH

#5


0  

Creating a new Workspace directory on Eclipse startup solved the problem for me.

在Eclipse启动时创建一个新的工作空间目录解决了我的问题。

#1


9  

Typically, g++ will be installed when gcc (GNU Compiler Collection) is installed. First confirm that you have g++ installed.

通常,在安装gcc (GNU编译器集合)时将安装g++。首先确认已经安装了g++。

You can check this by typing the following in a terminal: which g++. The response ought to be /usr/bin/g++.

您可以通过在终端输入以下内容来检查这个:哪个g++。响应应该是/usr/bin/g++。

If you find g++ installed, in eclipse go to project->properties->C/C++ Build->Discovery Options, under tools GCC C++ Compiler, put the exact path to g++ instead of g++ (if g++ alone does not work).

如果你在eclipse中发现了g++的安装,那么在eclipse中,>的属性-> - C/ c++构建->的发现选项,在工具GCC c++编译器下,将正确的路径改为g++而不是g++(如果g+单独不工作)。

You will find this link useful: What is the difference between g++ and gcc?

你会发现这个链接很有用:g++和gcc的区别是什么?

If you still have problems, do get back with feedback.

如果你还有问题,一定要及时反馈。

#2


9  

I had similar problem and it is solved by

我遇到了类似的问题,解决了。

  1. Installing g++ The GNU C++ complier using ubuntu software centre and

    使用ubuntu软件中心安装g++的GNU c++编译器。

  2. Changing in -

    改变,

    Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build in Complier Settings [Shared]

    窗口->首选项-> C/ c++ ->构建->设置->发现-> CDT GCC在编译器设置中构建[共享]

    From: ${COMMAND} -E -P -v -dD "${INPUTS}"

    从:${命令}-E -P -v -dD“${input}”

    To: /usr/bin/${COMMAND} -E -P -v -dD "${INPUTS}"

    To: /usr/bin/${命令}-E -P -v -dD“${input}”

I hope it helps. I think if you add it to the project as mentioned in the first answer, you will need to add all the time for new projects. And if you add as I wrote you don't need to add it for new projects.

我希望它有帮助。我认为,如果您将其添加到第一个答案中提到的项目中,您将需要为新项目添加所有时间。如果你加上我写的,你不需要把它添加到新项目中。

#3


1  

I have exactly the same problem. I never had problems with eclipse before under linux and now it wont even compile code. I tried to change the name of the g++ and gcc compilers to their exact location in project->properties->c/c++ Build->discovery options etc. nothing helped, I tried to reinstall eclipse and did an initialize, added the path to the variables etc.. Nothing worked so fare. The project I am working on is quiet big and I rather would like eclipse to manage the source and makefile, instead of doing it manually

我也有同样的问题。在linux下,我从来没有遇到过eclipse的问题,现在它甚至不会编译代码。我尝试将g++和gcc编译器的名称改为project->属性->属性-> - c/c++构建->发现选项等等,没有任何帮助,我尝试重新安装eclipse并进行了初始化,增加了变量的路径等。没有工作。我正在开发的项目是非常安静的,我宁愿使用eclipse来管理源文件和makefile,而不是手工操作。

Linux Mint 15 Eclispe: Version: 3.8.1 (I tried it with the latest version as well ... nothing changed)

Linux Mint 15 Eclispe:版本:3.8.1(我试用了最新版本……)没有改变)

g++ --version g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++——版本g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3版权(C) 2012免费软件基金会,这是免费软件;查看复制条件的源代码。没有保证;即使是对适销性或适合某一特定用途。

gcc --version gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc——版本gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3版权(C) 2012免费软件基金会,这是免费软件;查看复制条件的源代码。没有保证;即使是对适销性或适合某一特定用途。

example:

例子:

#include // not resolved using namespace std;

int main() {
    std::cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}

Well the code above is not what bothers me, as I can fix it by adding the includes of the exact c++ include path, but the code just wont compile. Wired enough eclipse gives me the error:

上面的代码并不是困扰我的问题,因为我可以通过添加正确的c++ include路径来修复它,但是代码不会编译。连线到足够的eclipse给我错误:

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

描述资源路径位置类型程序“g++”没有在路径首选项,c++ /构建/设置/发现,[CDT GCC Builtin编译器设置]选项C/ c++扫描仪发现问题。

but it appears to me to be possible to compile single files, by opening them and pressing crt+b, but the whole project wont compile.

但是在我看来,通过打开和压缩crt+b来编译单个文件是可能的,但是整个项目不会编译。

Fixed the problem this morning:
- got the latest eclipse
- created a new workspace
- created a new project

修正了今天早上的问题:-获得了最新的eclipse -创建了一个新的工作空间-创建了一个新的项目。

after a few seconds the very same error disappears

几秒钟后,同样的错误消失了。

#4


1  

This issue was fixed for me once I deleted eclipse's .metedata folder, called eclipse -initialize from the command line and started eclipse again. HTH

当我删除eclipse的.metedata文件夹时,这个问题就被修复了,它被称为eclipse -初始化命令行,并再次启动eclipse。HTH

#5


0  

Creating a new Workspace directory on Eclipse startup solved the problem for me.

在Eclipse启动时创建一个新的工作空间目录解决了我的问题。