SlideShare a Scribd company logo
What is gcc?

Gcc- stands for GNU C/C++ Compiler
- a popular console-based compiler for *NIX platforms and others; can cross-
compile code for various architectures
- gcc to compile C programs; g++ for C++
- can actually work also with ADA, Java, and a couple other languages
- gcc performs all of these:
   1.   preprocessing,
   2.   compilation,
   3.   assembly, and
   4.   linking
As always: there is man gcc
Options

There are alot of them, but there are some the most often
used ones:

To compile: -c
Specify output filename: -o <filename>
Include debugging symbols: -g
Show all (most) warnings: -Wall
Options

There are zillions of them, but there are some the most
often used ones:
To compile: -c
Specify output filename: -o <filename>
Include debugging symbols: -g
Show all (most) warnings: -Wall
Be stubborn about standards: -ansi and -pedantic
Optimizations: -O, -O*
Options: -c

- gcc performs compilation and assembly of the
source file without linking.
- The output are usually object code files, .o;
they can later be linked and form the desired
executables.
- Generates one object file per source file
keeping the same prefix (before .) of the filename.
Options: -o <filename>

- Places resulting file into the filename specified instead
of the default one.
- Can be used with any generated files (object,
executables, assembly, etc.)
- If you have the file called source.c; the defaults are:
source.o if -c was specified
a.out if executable
- These can be overridden with the -o option.

More Related Content

PDF
Emscripten, asm.js, and billions of math ops
PDF
Linux containers
PPT
Raspberry Pi for IPRUG
PDF
Unix Ramblings
PDF
Gameboy emulator in rust and web assembly
PDF
Make A Shoot ‘Em Up Game with Amethyst Framework
PPTX
BeagleBone Black with Upstream Software
Emscripten, asm.js, and billions of math ops
Linux containers
Raspberry Pi for IPRUG
Unix Ramblings
Gameboy emulator in rust and web assembly
Make A Shoot ‘Em Up Game with Amethyst Framework
BeagleBone Black with Upstream Software

What's hot (20)

PDF
BeagleBone Black: Platform Bring-Up with Upstream Components
PDF
There is more to C
PDF
Introduction to nand2 tetris
PDF
Beta kate
PDF
Chrome Web MIDI 2015
PDF
Introduction to Modern U-Boot
PDF
Redis clustering
DOCX
Dev c++using
PPTX
Introduction to C language
PDF
OSMC 2014: Introduction into collectd | Florian Foster
PDF
Intro to introducing rust to ruby
PDF
Web MIDI API update
PDF
Development and deployment with composer and kite
PDF
LibreSSL
PDF
pdb like a pro
PPTX
Redis
PDF
Ansible Inventory Plugins
PDF
A Python Tutorial
ODP
Virtual domains
PDF
Running openCV project on Mac OS
BeagleBone Black: Platform Bring-Up with Upstream Components
There is more to C
Introduction to nand2 tetris
Beta kate
Chrome Web MIDI 2015
Introduction to Modern U-Boot
Redis clustering
Dev c++using
Introduction to C language
OSMC 2014: Introduction into collectd | Florian Foster
Intro to introducing rust to ruby
Web MIDI API update
Development and deployment with composer and kite
LibreSSL
pdb like a pro
Redis
Ansible Inventory Plugins
A Python Tutorial
Virtual domains
Running openCV project on Mac OS
Ad

Viewers also liked (20)

PPTX
Announcements for june 2014
PPTX
Announcements for june 2013
PPTX
December 2012 announcements
PPTX
February 2013 announcements
TXT
Command GM
PPTX
Plumbing Point Loma- Frozen Pipes
PPTX
Announcements for june 2014
PPTX
November 2012 announcements
PPTX
Android and Smartphones
PPTX
Horror film trailer analysis
PPT
第3回twitter研究会「閉会の挨拶」
PPTX
Announcements for june 2013
PDF
Hoarding
PPT
Paralle programming 2
PPTX
Announcements for june 2013
PPTX
September 2012 announcements
PPTX
Announcements for May 2014
PDF
赤字決算の対処法
PPTX
July 2012 announcements
PPTX
November 2012 announcements
Announcements for june 2014
Announcements for june 2013
December 2012 announcements
February 2013 announcements
Command GM
Plumbing Point Loma- Frozen Pipes
Announcements for june 2014
November 2012 announcements
Android and Smartphones
Horror film trailer analysis
第3回twitter研究会「閉会の挨拶」
Announcements for june 2013
Hoarding
Paralle programming 2
Announcements for june 2013
September 2012 announcements
Announcements for May 2014
赤字決算の対処法
July 2012 announcements
November 2012 announcements
Ad

Similar to GCC (20)

PPT
GCC compiler
PPTX
G++ & GCC
PDF
GNU Compiler Collection - August 2005
PDF
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
PDF
Compiler design notes phases of compiler
PDF
Programming in Linux Environment
PPTX
Gnu debugger
PPTX
GNU Debugger
PDF
Eclipse - Installation and quick start guide
PDF
The compilation process
PDF
[E Book] Linux, G C C X G C C The Gnu C C++ Language System For Emb...
PPT
Advanced c programming in Linux
PPTX
C compilation process
ODP
C Under Linux
ODP
PDF
C tour Unix
PDF
Linux shell ggsipu-lug
PDF
Linux programming
PDF
C programming first_session
GCC compiler
G++ & GCC
GNU Compiler Collection - August 2005
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
Compiler design notes phases of compiler
Programming in Linux Environment
Gnu debugger
GNU Debugger
Eclipse - Installation and quick start guide
The compilation process
[E Book] Linux, G C C X G C C The Gnu C C++ Language System For Emb...
Advanced c programming in Linux
C compilation process
C Under Linux
C tour Unix
Linux shell ggsipu-lug
Linux programming
C programming first_session

More from Anshul Sharma (11)

PPTX
Understanding concurrency
PPT
Interm codegen
PPT
Programming using Open Mp
PPT
Open MPI 2
PPT
Open MPI
PPT
Parallel programming
PPT
PPT
PPT
Cuda intro
ODP
Intoduction to Linux
Understanding concurrency
Interm codegen
Programming using Open Mp
Open MPI 2
Open MPI
Parallel programming
Cuda intro
Intoduction to Linux

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Spectroscopy.pptx food analysis technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
Spectroscopy.pptx food analysis technology
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
sap open course for s4hana steps from ECC to s4
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”

GCC

  • 1. What is gcc? Gcc- stands for GNU C/C++ Compiler - a popular console-based compiler for *NIX platforms and others; can cross- compile code for various architectures - gcc to compile C programs; g++ for C++ - can actually work also with ADA, Java, and a couple other languages - gcc performs all of these: 1. preprocessing, 2. compilation, 3. assembly, and 4. linking As always: there is man gcc
  • 2. Options There are alot of them, but there are some the most often used ones: To compile: -c Specify output filename: -o <filename> Include debugging symbols: -g Show all (most) warnings: -Wall
  • 3. Options There are zillions of them, but there are some the most often used ones: To compile: -c Specify output filename: -o <filename> Include debugging symbols: -g Show all (most) warnings: -Wall Be stubborn about standards: -ansi and -pedantic Optimizations: -O, -O*
  • 4. Options: -c - gcc performs compilation and assembly of the source file without linking. - The output are usually object code files, .o; they can later be linked and form the desired executables. - Generates one object file per source file keeping the same prefix (before .) of the filename.
  • 5. Options: -o <filename> - Places resulting file into the filename specified instead of the default one. - Can be used with any generated files (object, executables, assembly, etc.) - If you have the file called source.c; the defaults are: source.o if -c was specified a.out if executable - These can be overridden with the -o option.