【发布时间】:2015-03-22 22:04:18
【问题描述】:
我在 Windows 7 中安装了 Cygwin。然后我将环境变量设置为路径“C:\cygwin\bin”,但是当我尝试构建一个简单的“helloworld.c”文件时,它显示以下内容:
[Error 2] The system cannot find the file specified
[cmd: [u'g++', u'C:\\programs\\helloworld.c', u'-o', u'C:\\programs/helloworld']]
[dir: C:\programs]
[path: C:\cygwin\bin;C:\cygwin\bin;C:\cygwin\bin;C:\TC\BIN]
[Finished]
我写的代码如下:
#include <stdio.h>
main()
{
printf("Hello, world\n");
}
如何解决?
【问题讨论】:
-
cygwin 使用 /cygdrive 作为在文件名中指定驱动器的替代方法...例如: /cygdrive/c/programs/helloworld.c 用于您的程序。或者,如果该文件位于 cygwin 安装树中,那么您可以将其相对于 cygwin 的安装位置指定为 root。
-
你安装了 gcc/g++ 吗?
-
好的...我想我在安装过程中错过了选择软件包.....现在有人可以指导我如何卸载 Cygwin 吗?
-
你不需要卸载它...只需重新运行你最初运行的安装程序(setup-x86.exe或setup-x86_64.exe)...当你得到到软件选择屏幕,选择 gcc...它们将被添加到您的安装中。
-
谢谢老兄...照你说的做...很快就会更新这篇文章!
标签: c build cmd cygwin sublimetext2