Jump to content

"cannot execute binary file" when running .out


Guest abecc2000
 Share

Recommended Posts

Guest abecc2000

I am relatively new to linux. I use Red Hat at school, and have Mandriva 2007 installed here at home. I have run into a problem with Mandriva where, when I try to execute a simple .out file, I get the message "cannot execute binary file".

 

I compiled the .out file with the following command:

 

g++ test.out -o test.cpp

 

and then ran it with the command:

 

sh test.out

 

Can anybody help?

 

Thanks

Link to comment
Share on other sites

sh is only used on shell/bash scripts, not on compiled programs.

 

First, we need to make the file executable (assuming the compiler didn't do this for you):

chmod +x test.out

Then, we execute it:

./test.out

This should execute the program. Note that these instructions assume you are in the same directory as the file - if not, you must give it the full path to the file.

 

p.s. - welcome to the board :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...