GCC

From Script | Spoken-Tutorial
Revision as of 10:36, 11 December 2012 by Minal (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

You are here: Main Page >> GCC

Introduction

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.

Slide Template for GCC

Usage

The GCC usage can be divided into following three levels Basic level, Intermediate level and Advanced level.

Basic 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 C programs

  • Compilation of single file.
  • Compilation with specifying output file.
  • Compilation of multiple files.

Compilation of C++ programs

  • Compilation of C++ program.
  • Various compilation flags.

Basic GCC Warning Options

  • Discussing various GCC warning options for beginners.

Advanced GCC Warning Options

  • Discussing various GCC warning options in an advanced level.

Basic C++ Warning Options

  • Discussing various C++ specific warning options at the basic level.

Advanced C++ Warning Options

  • C++ specific warning options in an advanced level.

Use Of Preprocessor

  • Defining a macro.
  • Defining value for a macro.
  • Preprocessing the source file.

Intermediate Level

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.

Creation and use of Library

  • Static library.
  • Shared library.

Using Make files

  • Building executable using make file.
  • Building library using make file.

Debugging

  • Debugging a program.
  • Debugging using core file.

C++ Templates

  • Use of Function templates.
  • Use of Class templates.

C++ Standard Template Library

  • Use of Containers and Algorithms

Advanced Level

Advanced level covers optimization and profiling.

Profiling and Coverage tool

  • Use of profiler tool gprof.
  • Use of coverage tool gcov.

Optimization

  • Discussion of various optimization levels.
  • Use of optimization levels.

Installation

In this section, we will cover installation of GCC.

GCC Installation

Useful tools

In this section, we will discuss various tools useful for C, C++ developer.

Doxygen

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 usage and installation

  • Doxygen installation.
  • Doxygen usage.
  • Documenting the code in Doxygen commenting style.

Doxygen configuration file

  • Doxygen configuration file.
  • Doxywizard tool and its usage.

Cscope

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 usage and installation

  • Cscope installation.
  • Cscope usage.
  • Cscope User Interface.

Contributors and Content Editors

Minal