我编译了这个程序:
#include <stdio.h>
int main()
{
printf("Hello World!");
return 0;
}
使用这个命令:
gcc -c "hello.c" -o hello
当我尝试执行hello时,我得到了:
bash: ./hello: Permission denied
由于权限不足,
-rw-r--r-- 1 nathan nathan 856 2010-09-17 23:49 hello
由于某些原因??
但是无论如何...在更改权限并尝试再次执行后,我得到了:
bash: ./hello: cannot execute binary file
我正在使用gcc(Ubuntu 4.4.3-4ubuntu5)4.4.3
我在这里做错了什么?很明显...对于我来说太晚了,因为我疲惫不堪地用我的疲倦的眼睛尝试解决这个简单的问题....
P.S. 我有时会处理比Hello World更复杂的程序,但gcc会在所有情况下都遇到此问题...
gcc -Wall -g hello.c -o hello
) - Basile Starynkevitch