从dos命令运行cygwin内置exe文件

从dos命令运行cygwin内置exe文件,cygwin,command-prompt,Cygwin,Command Prompt,我在Cygwin中构建了一个exe(来自.cc的文件)。当我在Cygwin命令提示符下运行时,它运行得很好,例如 $./learn.exe 0.2 0.1 给出预期输出 当我从Windows命令提示符调用cygwin并运行相同的命令时,例如 c:\cygwin\bin\bash -c "./learn.exe 0.1 0.1" 它给出了错误的说法 error while loading shared libraries: ?: cannot open shared object file:

我在Cygwin中构建了一个exe(来自.cc的文件)。当我在Cygwin命令提示符下运行时,它运行得很好,例如

$./learn.exe 0.2 0.1
给出预期输出

当我从Windows命令提示符调用cygwin并运行相同的命令时,例如

c:\cygwin\bin\bash -c "./learn.exe 0.1 0.1"
它给出了错误的说法

error while loading shared libraries: ?: cannot open shared object file:
No such file or directory

Cygwin.EXE文件应在Windows命令行中运行。如果您位于带有
learn.exe
的目录中,则可以按以下方式运行它:

learn.exe 0.1 0.1
(如果您需要大量参数或良好的参数解析,那么在Cygwin Bash中运行可能会更好。)