在CentOS 7下安装gcc,gcc是编译和运行C语言的工具,

安装命令:

yum install gcc

中途如果有询问则输入y

安装成功后,通过以下命令

gcc --version

来查看安装的gcc版本

  具体安装可以查看http://www.centoscn.com/image-text/config/2015/0502/5329.html

进行测试:

hello.c的代码

#include <stdio.h>
void main(){
printf("Hello World");
}

对代码进行编译和连接,并生成可执行文件

gcc hello.c -o hello.exe

hello.c为源文件,-o 表示编译并链接,hello.exe为编译结果,可以自定义输出名

    更多关于gcc编译的例子可以查看http://man.linuxde.net/gcc

执行编译后的文件

./hello.exe

Linux下执行命令 ./可执行文件名

  如果出现cannot execute binary file错误,可以参考https://zhidao.baidu.com/question/455297951.html

最新文章

  1. 不使用ASP.NET中的服务器控件将如何上传文件?
  2. 嵌入式linux中使用 DHCP功能描述
  3. python turtle,random,math
  4. SQL Server 性能优化之——重复索引
  5. input[type=&quot;button&quot;]与&lt;button&gt;的区别
  6. Springboot与Mybatis整合
  7. CTSC&amp;APIO2017
  8. JavaWeb学习日记----XML的解析
  9. (三)underscore.js框架Objects类API学习
  10. facebook api之Access and Authentication
  11. 响应式布局与bootstrap框架
  12. Elasticsearch cluster health: yellow unassigned shards
  13. 验证码识别 图像降噪 算法 Python (二)
  14. kafka进阶
  15. MVC ---- Lambda表达式
  16. Flutter - Stateful(有状态) 和 stateless(无状态) widgets
  17. JavaScript运算符:递增和递减(++i,--i 和 i++,i-- 的区别)
  18. jstorm系列-2:入门
  19. poj 3249(bfs+dp或者记忆化搜索)
  20. ArrayList使用

热门文章

  1. 上传图片JS插件Plupload
  2. noip第28课作业
  3. POJ2739 Sum of Consecutive Prime Numbers 2017-05-31 09:33 47人阅读 评论(0) 收藏
  4. Eclipse tomcat配置 未在Eclipse中添加.jar包出错
  5. 微信小程序-bindtap事件与冒泡
  6. libgdx游戏中的中文字体工具类
  7. Ubuntu下mount命令的好用处
  8. AlexNet详解3
  9. IIS日志存入数据库之一:ODBC
  10. Ubuntu18.04 - 安装深度桌面(Deepin Linux Desktop)