Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-15-2004, 09:34 PM
|
#1
|
LQ Newbie
Registered: Nov 2004
Posts: 27
Rep:
|
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
|
|
|
11-15-2004, 09:45 PM
|
#2
|
Member
Registered: Nov 2000
Location: Hermon, ME
Distribution: slackware
Posts: 201
Rep:
|
what are the permissions on it? try chmod a+x hello.o and see if that helps
|
|
|
11-15-2004, 10:17 PM
|
#3
|
LQ Newbie
Registered: Nov 2004
Posts: 27
Original Poster
Rep:
|
mAineAc thanx but i had already tried that the permission printout for the file look like :
-rwxr-xr-x hello.o
any other suggestions ??
|
|
|
11-15-2004, 10:57 PM
|
#4
|
Member
Registered: Oct 2004
Location: US
Distribution: Fedora Core 1
Posts: 43
Rep:
|
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. 
|
|
|
11-15-2004, 11:30 PM
|
#5
|
LQ Newbie
Registered: Nov 2004
Posts: 27
Original Poster
Rep:
|
thanx again but , thats doesnt seem to be the problem
|
|
|
11-16-2004, 06:52 AM
|
#6
|
Member
Registered: Nov 2000
Location: Hermon, ME
Distribution: slackware
Posts: 201
Rep:
|
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.
|
|
|
11-16-2004, 09:33 AM
|
#7
|
LQ Newbie
Registered: Nov 2004
Posts: 27
Original Poster
Rep:
|
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
|
|
|
11-16-2004, 10:56 AM
|
#8
|
Member
Registered: Nov 2000
Location: Hermon, ME
Distribution: slackware
Posts: 201
Rep:
|
ok then do:
g++ hello.cpp -o hello
|
|
|
11-19-2004, 01:16 PM
|
#9
|
LQ Newbie
Registered: Nov 2004
Posts: 27
Original Poster
Rep:
|
mAineAc, thanx for the help , the commands worked !
|
|
|
All times are GMT -5. The time now is 08:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|