从Windows Cmd的Cygwin的击未运行可执行文件 [英] Cygwin Bash from Windows Cmd Not Running Executable

查看:258
本文介绍了从Windows Cmd的Cygwin的击未运行可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我已经在Cygwin中编译的程序,那我想从一个批处理文件调用一拉:

I have a program I've compiled in cygwin, that I am trying to call from a batch file a la:

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

但我得到的错误:

But I am getting the error:

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

当我Test.exe文件里面cygwin的,我得到:

When I file test.exe inside cygwin, I get:

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

任何想法,为什么它不会跑?大部分我在网上发现的错误都是从人试图运行Linux应用程序,但这是直接在cygwin的编译(通过G ++)(在同一台机器上)。

Any ideas why it won't run? Most of the errors I've found online are from people trying to run Linux apps, but this is something compiled (via g++) directly in cygwin (on the same machine).

在Windows 8中,如果它很重要。

On Windows 8 if it matters.

推荐答案

您可以尝试 -c<指挥GT;

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

这运行的test.exe一个bash shell下。 上-c选项详细

This runs test.exe under a bash shell. 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命令。任何剩余的参数被分配到
  位置参数,以$ 0起始。

-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 启动一个的交互的shell ,这不是你想要的东西在这种情况下。

-i starts an interactive shell, that is not something you want in this case.

最后完成的缘故 - bash有 - rcfile<文件路径> 选项来启动文件

Finally for the sake of completion - bash has --rcfile <file path> option to give a startup file.

这篇关于从Windows Cmd的Cygwin的击未运行可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆