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

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

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

GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005Saleem Ansari
 
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)Ahmed El-Arabawy
 
From gcc to the autotools
From gcc to the autotoolsFrom gcc to the autotools
From gcc to the autotoolsThierry Gayet
 
Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical trainingThierry Gayet
 
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...bhargavi804095
 
Raspberry pi Part 3
Raspberry pi Part 3Raspberry pi Part 3
Raspberry pi Part 3Techvilla
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To SymbianMark Wilcox
 
Programming in Linux Environment
Programming in Linux EnvironmentProgramming in Linux Environment
Programming in Linux EnvironmentDongho Kang
 
LOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfLOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfThninh2
 
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].pptxCoolGamer16
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxNEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJmeharikiros2
 

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 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
 
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

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

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.