ubuntu12.04下c语言开发环境搭建

据linux c一站式编程讲,linux下c语言开发需要如下工具:

  • gcc: The GNU C compiler
  • libc6-dev: GNU C Library: Development Libraries and Header Files
  • manpages-dev: Manual pages about using GNU/Linux for development
  • manpages-posix-dev: Manual pages about using a POSIX system for development
  • binutils: The GNU assembler, linker and binary utilities
  • gdb: The GNU Debugger
  • make: The GNU version of the “make” utility

一.安装gcc编译器(ubuntu自带gcc)

sudo apt-get install build-essential

使用gcc --version查看版本

 

二.hello wrold

#include <stdio.h>

int main(void)
{
  printf("hello world/n");
  return 0;
}

打开shell,执行

gcc hello.c -o hello

如果不加-o选项,默认输出a.out

然后运行使用./hello或者./a.out

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值