【发布时间】:2015-06-03 03:06:13
【问题描述】:
为了避免重新输入长命令到 MSYS 进行配置,我通常使用批处理文件来存储命令,如下所示:
./configure \
--arch=x86_64 \
--target-os=win64 \
--toolchain=msvc \
--enable-cross-compile \
--enable-gpl \
--disable-debug \
--enable-shared \
这种方式适用于 MSYS。但是当我在 MSYS2 中运行批处理文件时,它发现了许多错误消息,例如:
'.' is not recognized as an internal or external command,
operable program or batch file.
'--arch' is not recognized as an internal or external command,
operable program or batch file.
etc...
谁能解释一下是什么原因?
【问题讨论】:
-
您可能是在 bash shell 中运行批处理文件。您想学习如何编写 shell 脚本而不是批处理文件。
-
@RetiredNinja。你的意思是 MSYS2 是一个 bash shell 而 MSYS 不是?。
-
@MattMcNabb。我应该使用什么行结尾来代替“\”字符?
-
我的意思是,检查文件上是否没有 Windows 样式的行尾。例如,通过
dos2unix运行它并检查没有空格。 -
@MattMcNabb。我按照你的提示做了,但没有帮助。可能使用bat文件不是处理msys2的正确方法。还是谢谢。
标签: windows msys mingw-w64 msys2