从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.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcghcih
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20