[英]cygwin cannot find my compiler from /cygdrive
I have a makefile which invokes my compiler from /cygdrive/c/path/to/compiler
我有一个makefile,它从
/cygdrive/c/path/to/compiler
调用我的编译/cygdrive/c/path/to/compiler
when I'm in a cygwin shell, I can invoke it correctly, but from inside a makefile, the absolute path returns "The system cannot find the file specified"
. 当我在cygwin shell中时,可以正确调用它,但是从makefile内部,绝对路径返回
"The system cannot find the file specified"
。
I don't understand why the makefile does not understand the absolute cygdrive path 我不明白为什么makefile不了解绝对cygdrive路径
edit* 编辑*
In fact, any command with absolute path will fail. 实际上,任何具有绝对路径的命令都将失败。
/usr/bin/touch
will also return "The system cannot find the file specified"
. 还将返回
"The system cannot find the file specified"
。
It is bad practice to use absolute paths to executables in Makefiles. 在Makefile中使用绝对路径指向可执行文件是不明智的做法。 You should be able to put this in the Makefile
您应该可以将其放入Makefile中
CC=gcc
then as long as gcc.exe
is on your PATH
it will work. 那么只要
gcc.exe
在您的PATH
就可以使用。 If you happen to be cross-compiling you could run this from the command line 如果碰巧是交叉编译,则可以从命令行运行
make CC=i686-w64-mingw32-gcc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.