LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   None of the compliers working, a "can not execute binary file" problem (https://www.linuxquestions.org/questions/linux-newbie-8/none-of-the-compliers-working-a-can-not-execute-binary-file-problem-679082/)

jason_zhang 10-25-2008 10:58 PM

None of the compliers working, a "can not execute binary file" problem
 
Hi, all,

My gcc, g++ and gfortran compliers stopped work today. Whenever and what ever I asked them to day anything, it always says "can not execute binary file!"

I am on Suse 10.2, in BASH, and have been desperately trying to solve the problem for meeting a deadline. Could someone help me as soon as possible?

Thanks in advance for any help.

Jason

weibullguy 10-26-2008 12:57 AM

And what have you done other than post here? What were the results of the actions you've taken?

unihiekka 10-26-2008 12:12 PM

A compiler does not execute binary files! It, hopefully, creates them, but executing them is something that is not done by the compiler. Compilation of a c++ programme with g++ is as follows:

Code:

g++ -o prog prog.cpp
where prog is the binary created and prog.cpp is the source. Executing it means that you have to type

Code:

./ prog
in the right directory, where prog is. If prog is in your $PATH, then you can simply type prog in the console in any directory.

i92guboj 10-26-2008 12:29 PM

When describing a problem, post *exactly* what did you do, and paste the results. Otherwise, we have to guess things which is sometimes a waste of time because we might guess the wrong thing.

If you mean that running gcc produces that error, then I guess that either your compilers or/and your glibc are broken or incompatible, in which case a reinstallation of the whole toolchain will be needed to restore the compilers functionality.

If you mean that the binaries produced by gcc are producing that error, then the problem might be that you are not using gcc the right way. A common mistake that some people often make is to compile the final binary using -c, which compiles, but doesn't produce a working executable file because it doesn't link against the needed libs.

PS: In the first case, I would also try to run fsck from a livecd. Maybe the problem has to do with file system corruption.


All times are GMT -5. The time now is 01:27 AM.