PDA

View Full Version : [ubuntu] "cannot execute binary" error in terminal after install of 10.04



charkear
May 14th, 2010, 06:14 PM
After upgrading to 10.04 I can not execute any binaries I compile inside the terminal. I compile a hello world program and try to run it I get the error. This happens for any program I compile and try to run.

Note the permissions for this file permit execution.



gcc hello.c -o hello
. ./hello
bash: .: ./hello: cannot execute binary file

charkear
May 17th, 2010, 06:35 PM
When I do "strace" on a compiled program I get the following errors.


access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)


EDIT: Apparently this isn't a problem.

charkear
May 25th, 2010, 11:09 PM
I have a solution.


When I run a program like this:

$ ./hello

There are no problems.

When I run a program like this:

$ . ./hello

I get the error.