lysliberty(liberty)老兄你的编译方法不对gcc -c test test.c 只是生成 .o 文件我们还需要gcc -o test test.o才能生成可执行文件。
-c 的含义:
Compile or assemble the source files, but do not link. The linking stage simply is not done. The ultimate output is in the form of an object file for each source file.
[root@localhost demo]# gcc -o test test.c
[root@localhost demo]# ./test
This is test[root@localhost demo]#
~~~~~~~~~~~~不加换行
main()
{
printf("This is a Test!\n");
}
应该出来了吧...