SlideShare a Scribd company logo
1 of 5
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

What's hot

Introduction to C language
Introduction to C languageIntroduction to C language
Introduction to C language
Ketan Chaoji
 

What's hot (20)

File Handling Program
File Handling ProgramFile Handling Program
File Handling Program
 
BeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream ComponentsBeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream Components
 
There is more to C
There is more to CThere is more to C
There is more to C
 
Introduction to nand2 tetris
Introduction to nand2 tetrisIntroduction to nand2 tetris
Introduction to nand2 tetris
 
Beta kate
Beta kateBeta kate
Beta kate
 
Chrome Web MIDI 2015
Chrome Web MIDI 2015Chrome Web MIDI 2015
Chrome Web MIDI 2015
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Redis clustering
Redis clusteringRedis clustering
Redis clustering
 
Dev c++using
Dev c++usingDev c++using
Dev c++using
 
Introduction to C language
Introduction to C languageIntroduction to C language
Introduction to C language
 
OSMC 2014: Introduction into collectd | Florian Foster
OSMC 2014: Introduction into collectd | Florian FosterOSMC 2014: Introduction into collectd | Florian Foster
OSMC 2014: Introduction into collectd | Florian Foster
 
Intro to introducing rust to ruby
Intro to introducing rust to rubyIntro to introducing rust to ruby
Intro to introducing rust to ruby
 
Web MIDI API update
Web MIDI API updateWeb MIDI API update
Web MIDI API update
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kite
 
LibreSSL
LibreSSLLibreSSL
LibreSSL
 
pdb like a pro
pdb like a propdb like a pro
pdb like a pro
 
Redis
RedisRedis
Redis
 
Ansible Inventory Plugins
Ansible Inventory PluginsAnsible Inventory Plugins
Ansible Inventory Plugins
 
A Python Tutorial
A Python TutorialA Python Tutorial
A Python Tutorial
 
Virtual domains
Virtual domainsVirtual domains
Virtual domains
 

Viewers also liked

Android and Smartphones
Android and SmartphonesAndroid and Smartphones
Android and Smartphones
Philip David
 
Paralle programming 2
Paralle programming 2Paralle programming 2
Paralle programming 2
Anshul Sharma
 

Viewers also liked (20)

Announcements for june 2014
Announcements for june 2014Announcements for june 2014
Announcements for june 2014
 
Announcements for june 2013
Announcements for june 2013Announcements for june 2013
Announcements for june 2013
 
December 2012 announcements
December 2012 announcementsDecember 2012 announcements
December 2012 announcements
 
February 2013 announcements
February 2013 announcementsFebruary 2013 announcements
February 2013 announcements
 
Command GM
Command GMCommand GM
Command GM
 
Plumbing Point Loma- Frozen Pipes
Plumbing Point Loma- Frozen PipesPlumbing Point Loma- Frozen Pipes
Plumbing Point Loma- Frozen Pipes
 
Announcements for june 2014
Announcements for june 2014Announcements for june 2014
Announcements for june 2014
 
November 2012 announcements
November 2012 announcementsNovember 2012 announcements
November 2012 announcements
 
Android and Smartphones
Android and SmartphonesAndroid and Smartphones
Android and Smartphones
 
Horror film trailer analysis
Horror film trailer analysisHorror film trailer analysis
Horror film trailer analysis
 
第3回twitter研究会「閉会の挨拶」
第3回twitter研究会「閉会の挨拶」第3回twitter研究会「閉会の挨拶」
第3回twitter研究会「閉会の挨拶」
 
Announcements for june 2013
Announcements for june 2013Announcements for june 2013
Announcements for june 2013
 
Hoarding
HoardingHoarding
Hoarding
 
Paralle programming 2
Paralle programming 2Paralle programming 2
Paralle programming 2
 
Announcements for june 2013
Announcements for june 2013Announcements for june 2013
Announcements for june 2013
 
September 2012 announcements
September 2012 announcementsSeptember 2012 announcements
September 2012 announcements
 
Announcements for May 2014
Announcements for May 2014Announcements for May 2014
Announcements for May 2014
 
赤字決算の対処法
赤字決算の対処法赤字決算の対処法
赤字決算の対処法
 
July 2012 announcements
July 2012 announcementsJuly 2012 announcements
July 2012 announcements
 
November 2012 announcements
November 2012 announcementsNovember 2012 announcements
November 2012 announcements
 

Similar to GCC

Raspberry pi Part 3
Raspberry pi Part 3Raspberry pi Part 3
Raspberry pi Part 3
Techvilla
 
LOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfLOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdf
Thninh2
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
meharikiros2
 

Similar to GCC (20)

GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
 
GCC compiler
GCC compilerGCC compiler
GCC compiler
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
G++ & GCC
G++ & GCCG++ & GCC
G++ & GCC
 
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
 
From gcc to the autotools
From gcc to the autotoolsFrom gcc to the autotools
From gcc to the autotools
 
Toolchain
ToolchainToolchain
Toolchain
 
Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical training
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
 
C compilation process
C compilation processC compilation process
C compilation process
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...
 
Raspberry pi Part 3
Raspberry pi Part 3Raspberry pi Part 3
Raspberry pi Part 3
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To Symbian
 
Programming in Linux Environment
Programming in Linux EnvironmentProgramming in Linux Environment
Programming in Linux Environment
 
LOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfLOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdf
 
Gcc
GccGcc
Gcc
 
Basics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptxBasics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptx
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
 
C programming first_session
C programming first_sessionC programming first_session
C programming first_session
 

More from Anshul Sharma (11)

Understanding concurrency
Understanding concurrencyUnderstanding concurrency
Understanding concurrency
 
Interm codegen
Interm codegenInterm codegen
Interm codegen
 
Programming using Open Mp
Programming using Open MpProgramming using Open Mp
Programming using Open Mp
 
Open MPI 2
Open MPI 2Open MPI 2
Open MPI 2
 
Open MPI
Open MPIOpen MPI
Open MPI
 
Parallel programming
Parallel programmingParallel programming
Parallel programming
 
Cuda 3
Cuda 3Cuda 3
Cuda 3
 
Cuda 2
Cuda 2Cuda 2
Cuda 2
 
Cuda intro
Cuda introCuda intro
Cuda intro
 
Des
DesDes
Des
 
Intoduction to Linux
Intoduction to LinuxIntoduction to Linux
Intoduction to Linux
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

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.