今天在安装centos7后写了一个C语言的helloworld,因为我安装的centos版本内置了gcc,所以使用
gcc hello.c -o hello
编译文件,生成hello文件。然后使用./hello执行hello文件,报错显示bash: ./hello: cannot execute binary file
- 在网上一番搜索过后,还是没有针对我的问题的解决办法。然后我使用yum upgrade升级了所有软件,然后再次编译C文件,居然可以执行了。也许是因为gcc没有更新的缘故吧。
今天在安装centos7后写了一个C语言的helloworld,因为我安装的centos版本内置了gcc,所以使用
gcc hello.c -o hello
编译文件,生成hello文件。然后使用./hello执行hello文件,报错显示bash: ./hello: cannot execute binary file