Hello, GCC on Ubuntu

1) Install gcc on ubuntu:

sudo apt-get install gcc g++

sudo apt-get install build-essential

 

2) Write a Hello.c with VIM like this:

#include <stdio.h>

int main() {  printf(“Hello, gcc\n”); }

 

3) Compile & Link Hello.c like this:

gcc Hello.c -o Hello

 

4) After that you will see a file named “Hello” will be created under current working directory, input “./Hello”<Enter>.  Then you will see:

Hello, gcc

The full source code could be download from here.

posted @ 2012-08-24 08:05  opencoder  阅读(143)  评论(0编辑  收藏  举报