Pejman Moghadam / C-programming

GCC general options

Public domain


Compile and link (a.ot)

gcc hello.c

-c : Compile or assemble the source files, but do not link.

gcc -c hello.c
gcc hello.o

-o file : Output to file

gcc hello.c -o hello

-Dmacro=value : Define macro inside program as value

gcc -c -D_POSIX_C_SOURCE=199309L -DNDEBUG hello.c

-E : Preprocess ( do not compile & link ) output to sreen

-g : Produce debugging information in the operating system's native format

-Idir : Add include directory ( "file.h" -I- )

-Ldir : Add library directory ( -L. )

-lfile : Add library file ( -lpcap -> libpcap.a )

-O : Optimize

-Wall : Show all warnings -Wreturn-type : show return type mismatch warnings

-w : disable warnings


BY: Pejman Moghadam
TAG: c, gcc
DATE: 2011-05-28 15:02:14


Pejman Moghadam / C-programming [ TXT ]