How To compile c program in linux terminal
Hi friends to day i will guide you how to write and compile c program in Linux/Unix terminals. In order to execute c program in windows operating system first we have
to install it,But it is not the case in Linux/Unix , By default compilers installed in it.
Procedure
1.pico programname.c 2.gcc programname 3.whatis compilername
2.whereis compilername 4.mv name name1 5. ./output.c
6.ls 5.exit
1.Open Linux terminal:
First you have to open Linux or Unix they are many Linux flavors are available.
Am using backtrack Linux in oracle VM Virtual box.
1.1.Use whatis command for knowing about gcc
1.2.Use whereis command for locate compiler.
----->Type pico wish.c
2.Write program and Save it:
----->Type program name and save it.[save options find in bottom]
------> Press Y and press enter.
4.Compile program with GCC:
4.1.Compile program with gcc compiler like bellow
4.2.Out put name is a.out we can rename it.
5.See Result:
5.1. Type ./a.out command to see output.
6.We can rename this output name:
6.1. Type mv a.out wish press enter.
6.2 Type ./wish to see output.
Category: Linux, opensourcetools, Programming
0 comments