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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...