|
|
||||
|
|
gccReleased by the Free Software Foundation, gcc is a *nix-based C compiler usually operated via the command line. It often comes distributed with a *nix installation, so if you are running Unix or a Linux variant you likely have it on your system. You can invoke gc on a source code file simply by typinggcc filename The default executable output of gcc is "a.out". It is also possible to specify a name for the executable file at the command line by using the syntax -o outputfile, as shown in the following example: gcc filename -o outputfile GDB Ready CodeIf you want to prepare your executable for use by GDB, include the -g flag .gcc filename -g -o outputfileThis will enable GDB to give you detailed debugging information by including extra code in the executable file to allow GDB to find variable names and list the source code. Math LibraryIf you need to use functions from the math library (generally functions from math.h such as sin or sqrt), then you need to explicitly ask it to link with that library with the -l flag and the library 'm':gcc filename -o outputfile -lmNote that you do not need to use this flag with C++. Find Out MoreIf you are using a *nix system, you can also check out the other gcc commandline options by typingman gcc ----- |
|
||