Guest abecc2000 Posted January 31, 2007 Share Posted January 31, 2007 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 More sharing options...
tyme Posted January 31, 2007 Share Posted January 31, 2007 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 More sharing options...
Guest abecc2000 Posted February 2, 2007 Share Posted February 2, 2007 Thanks! That did it. Thanks for the welcome. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now