Friday, January 18, 2013

How to compile C program in ubuntu using gcc

1:48 PM

To compile your program using gcc compiler you need to download build essential library
so write on terminal

$sudo apt-get install build-essential

make a file called test.c

write a test C program


  • #include<stdio.h>
  • #include<stdlib.h>
  • int main()
  • {
  • printf("\nHello World\n\n");
  • return(0);
  • }

Save the program and go to the directory in which you have made your test.c


cd test.c

COMPILE 

gcc -Wall -W -Werror test.c -o test

RUN

./test

now your program is running.

Written by

We are one of the initiators of the development of information technology in understanding the need for a solution that is familiar and close to us.

0 comments:

Post a Comment

 

© 2013 Klick Dev. All rights resevered.

Back To Top