You are here: Main Page >> GCC
GNU Compiler Collection (GCC) is open source compiler system supporting various languages like C, C++, Java etc. GCC was initially developed as C compiler but later extended for languages like C++, Fortran, Pascal. Various Unix and Linux flavors have accepted GCC as standard compiler. Also GCC is available for embedded platforms. This documentation assumes that the reader has fair knowledge of C, C++ programming and Unix commands.
These tutorials are created using GCC version 4.5.1. Please see the associated text box of individual spoken tutorials on the website to decide the versions of GCC and OS to which it is applicable.
The Spoken Tutorial Effort for GCC is being contributed by Amit Gaikwad from IIT-Bombay. Other contributors who helped in the creation of the scripts are Gaurav Lahoti, IIT-Bombay and Abhishek, IIT-Bombay.
- 1 Introduction
- 2 Usage
- 2.1 Basic Level
- 2.2 Intermediate Level
- 2.3 Advanced Level
- 3 Installation
- 4 Useful tools
The GCC usage can be divided into following three levels Basic level, Intermediate level and Advanced level.
Basic level covers simple compilation of C programs. Also it covers understanding basic level warnings generated while compiling the C program and use of preprocessor. Additionally, it covers C++ topics like Compilation of C++ program and Warning options related to C++.
- Compilation of single file.
- Compilation with specifying output file.
- Compilation of multiple files.
- Compilation of C++ program.
- Various compilation flags.
- Discussing various GCC warning options for beginners.
- Discussing various GCC warning options in an advanced level.
- Discussing various C++ specific warning options at the basic level.
- C++ specific warning options in an advanced level.
- Defining a macro.
- Defining value for a macro.
- Preprocessing the source file.
Intermediate level covers creation of make files, compilation using make files, linking shared and static libraries and understanding debugging using gdb. Also it covers C++ topics like templates and Standard Template Library.
- Static library.
- Shared library.
- Building executable using make file.
- Building library using make file.
- Debugging a program.
- Debugging using core file.
- Use of Function templates.
- Use of Class templates.
- Use of Containers and Algorithms
Advanced level covers optimization and profiling.
- Use of profiler tool gprof.
- Use of coverage tool gcov.
- Discussion of various optimization levels.
- Use of optimization levels.
In this section, we will cover installation of GCC.
In this section, we will discuss various tools useful for C, C++ developer.
This is a documentation tool for C++, C. Doxygen can generate documentation in HTML format. Also it can develop documentation in RTF, PostScript, hyperlinked PDF, compressed HTML and Unix man page format. It extracts documentation from source code and thus can provide consistent documentation with source code.
- Doxygen installation.
- Doxygen usage.
- Documenting the code in Doxygen commenting style.
- Doxygen configuration file.
- Doxywizard tool and its usage.
This tool is used for browsing the source code. It can be used for C, C++. It helps in finding C symbol, global definition, a text string, replacing a text string, finding functions called by a function, finding functions calling a function, finding egrep pattern, finding a file, finding files including this file.
- Cscope installation.
- Cscope usage.
- Cscope User Interface.