cannot execute binary file
Hey ,
I am trying to execute a simple binary file hello.o on Red hat 9.0 i enter the commnand : ./hello.o The error message received is : bash: ./hello.o: cannot execute binary file any help would be greatly appreciated |
what are the permissions on it? try chmod a+x hello.o and see if that helps
|
mAineAc thanx but i had already tried that the permission printout for the file look like :
-rwxr-xr-x hello.o any other suggestions ?? |
Is it a C/C++ program? If so, then do you have the source code? If so, then try recompiling it. I had trouble like this on my university's UNIX server, and some weird bug makes it so you have to recompile almost everytime you run the prog.
If my assertions were wrong, then ignore this post, cuz it offers nothing. :p |
thanx again but , thats doesnt seem to be the problem
|
is this a program you wrote? If it is, is there any way you can share the source so that we can see what the problem is? You will get an error like that if you are trying to use some win api. like if you wrote it and compiled it with winc++ You didn't give any information about how it was compiled, written or anything except your trying to run it on rh 9. It is kinda hard to help a person in the dark.
|
Hey i am jus trying to compile a simple hello world program .....
#include<iostream> using namespace std ; int main () { cout << "hello " ; return 0 ; } i saved it as hello.cpp from the command terminal i used gcc : gcc -c hello.cpp which was good since it compiled giving a hello.o file this was where i encountered the problem. In trying to execute the program: ./hello.o i got the error message] bash: ./hello.o: cannot execute binary file I hope this information give u a clearer pic of what the problem actually is , thanx for the help |
ok then do:
g++ hello.cpp -o hello |
mAineAc, thanx for the help , the commands worked !
|
All times are GMT -5. The time now is 04:12 AM. |