C++ make: g++: 命令未找到

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13887225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 17:48:02  来源:igfitidea点击:

make: g++: Command not found

c++windowseclipseg++cygwin

提问by m4l490n

I've checked similar posts and anyone solve my problem. I's very simple but I'm new with eclipse. I'm trying to make a simple example and I'm having this problem.

我检查过类似的帖子,有人解决了我的问题。我很简单,但我是日食的新手。我正在尝试举一个简单的例子,但我遇到了这个问题。

the make file is just this

make 文件就是这个

all: hello.exe

clean:
    rm Hello.o Hello.exe

hello.exe: hello.o
    g++ -g -o hello.exe hello.o

hello.o:
    g++ -c -g main.cpp

And I get this error "make: g++: Command not found"

我收到此错误“make:g++:找不到命令”

Thanks for helping.

谢谢你的帮助。

采纳答案by hd1

You need to install the development tools from GNU. I assume you're on windows, in which case you have two options: cygwinand mingw. The former includes g++out of the box. I'm less familiar with mingw, but the C++ Standard libraryappears to, also, be available.

您需要从 GNU 安装开发工具。我假设你在 Windows 上,在这种情况下你有两个选择:cygwinmingw。前者包括开箱即用的g++。我对 mingw 不太熟悉,但C++ 标准库似乎也可用。

See these installation instructions, I'd recommend starting from step 1, if at all possible.

请参阅这些安装说明,如果可能的话,我建议从第 1 步开始。