Cygwin无法从/cygdrive找到我的编译器

cygwin cannot find my compiler from /cygdrive

本文关键字:我的 编译器 cygdrive Cygwin      更新时间:2023-10-16

我有一个从/cygdrive/c/path/to/compiler调用编译器的makefile

当我在 cygwin shell 中时,我可以正确调用它,但是从 makefile 内部,绝对路径返回 "The system cannot find the file specified" .

我不明白为什么制作文件不理解绝对的cygdrive路径

编辑*
事实上,任何具有绝对路径的命令都会失败。

/usr/bin/touch

也将返回"The system cannot find the file specified".

在生成文件中使用可执行文件的绝对路径是一种不好的做法。你应该能够把它放在制作文件中

CC=gcc

那么只要gcc.exe在你的PATH它就会起作用。如果你碰巧在交叉编译,你可以从命令行运行它

make CC=i686-w64-mingw32-gcc

裁判