g ++无法在Windows命令提示符下工作。 Cygwin安装 [英] g++ not working on Windows command prompt. Cygwin installed

查看:471
本文介绍了g ++无法在Windows命令提示符下工作。 Cygwin安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Eclipse和CDT(需要在eclipse CDT中使用C / C ++),以及安装Cygwin,以便我可以编译我的文件。

I have installed Eclipse and CDT (to use C/C++ in eclipse CDT is needed), as well as installing Cygwin so that I can compile my files.

在环境变量中,我设置了包含以下内容的路径:C:\cygwin\bin;

In environment variables I've set Path to include the following: "C:\cygwin\bin;"

g ++,make和GDC都是通过Cygwin安装的。

g++, make and GDC are all installed via Cygwin. I made sure of this by searching for them in the bin folder - they're all there.

如果在Windows命令提示符下输入make,则会出现以下内容:

If I enter "make" into the windows command prompt, this appears:

make: *** No targets specified and no makefile found.  Stop.

如果我在Windows命令提示符下输入g ++或gdc ):

If I enter "g++" or "gdc" into the windows command prompt, this appears (or similar):

'g++' is not recognized as an internal or external command,
operable program or batch file.

所以,换句话说,make是工作,但其余的不是...但他们在相同的bin文件夹!

So, in other words make is working but the rest isn't..but they're in the same bin folder! Has got me completely confused.

如果我试图打开Cygwin Bash Shell,g ++,make和GDC都可以在那里工作。

If I attempt to open Cygwin Bash Shell, g++, make and GDC all work there.

但是,我需要它在命令提示符下工作,以便Eclipse能够编译我在IDE中编写的程序。

However, I need it to work in the command prompt so that Eclipse is able to compile the programs I write in the IDE.

如果你知道为什么

推荐答案

我没有使用cygwin,但我的理解是你从cygwin bash shell使用它。

I haven't used cygwin much, but my understanding is you have to use it from the cygwin bash shell.

如果您需要g ++,make等,请使用 mingw ,使用它,g ++从普通的Windows命令行工作。

if you need g++, make, etc, use mingw, with it, g++ works from the normal windows command line.

这篇关于g ++无法在Windows命令提示符下工作。 Cygwin安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆