2

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

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

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

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).

On Windows 8 if it matters.

1 Answer 1

5

You may try -c <command >

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

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 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 starts an interactive shell, that is not something you want in this case.

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

Sign up to request clarification or add additional context in comments.

2 Comments

-c worked, not sure what the difference was, although I did have to change the path to the path that would be used be cygin, i.e., ../../cygdrive/c ...
@ Char Mourning : Hm. In my case windows path with forward / worked. (Mixed mode). It may be some thing with cygwin version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.