PDA

View Full Version : compilation in ubuntu



dharmes
June 9th, 2012, 06:19 AM
I am a engg student,
I am learning programming in C.
Hence, i want to execute a program in Ubuntu 12.04,
after referring to a book.
i learned to write (in terminal),
.
gcc -g -O0 -Wall infilename.c -o outfilename.o
gdb outfilename.o
or
gcc -Wall infilename.c -o outfilename.o
.
also by reading the posts in internet,
they say to write
simply.

gcc infilename.c -o outfilename
./outfilename
or
gcc -Wall -W -Werror infilename.c -o outfilename
./outfilename
or
gcc filename.c
./a.out

which one should i choose and when,
please explain me.
in a lay-man's language

Elfy
June 9th, 2012, 07:45 AM
Thread closed. Please do not post duplicates, it dilutes community effort.