• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

从Windows Cmd的Cygwin的击未运行可执行文件

用户头像
it1352
帮助1

问题说明

我有我已经在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.

正确答案

#1

您可以尝试 -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.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcghcih
系列文章
更多 icon
同类精品
更多 icon
继续加载