gpt4 book ai didi

windows - 来自 Windows Cmd 的 Cygwin Bash 未运行可执行文件

转载 作者:可可西里 更新时间:2023-11-01 09:43:23 26 4
gpt4 key购买 nike

我有一个在 cygwin 中编译的程序,我正试图从批处理文件中调用它:

D:\cygwin\bin\bash --login -i C:/ILS/trunk/NAVAID/test.exe

但是我得到了错误:

bash: C:/ILS/trunk/NAVAID/test.exe: cannot execute binary file

当我在 cygwin 中归档 test.exe 时,我得到:

test.exe: PE32 executable (console) Intel 80386, for MS Windows

知道为什么它无法运行吗?我在网上发现的大多数错误都来自尝试运行 Linux 应用程序的人,但这是直接在 cygwin 中(在同一台机器上)编译(通过 g++)的东西。

如果重要,在 Windows 8 上。

最佳答案

你可以试试-c <command >

D:\cygwin\bin\bash --login -c C:/ILS/trunk/NAVAID/test.exe

这会在 bash shell 下运行 test.exe。 Details on -c option

There are several single-character options that may be supplied at invocation which are not available with the set builtin.

-c string Read and execute commands from string after processing the options, then exit. Any remaining arguments are assigned to the positional parameters, starting with $0.

-i开始 interactive shell ,在这种情况下,这不是您想要的。

最后为了完成 - bash 有 --rcfile <file path>提供启动文件的选项。

关于windows - 来自 Windows Cmd 的 Cygwin Bash 未运行可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15721597/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com