Forrest logo
tool overview
On this page you find all important commands for the CLI tool gcc. If the command you are looking for is missing please ask our AI.

gcc

gcc stands for GNU Compiler Collection, and it is a command line tool used to compile and link source code written in different programming languages such as C, C++, and Fortran. It is available on multiple platforms, including Unix-like systems, Linux, macOS, and Windows.

Using gcc, developers can convert human-readable source code into machine-readable object code or executable files. The tool offers various optimization options to improve the performance of the compiled code, and it supports different levels of debugging information.

gcc supports a wide range of programming language standards and offers extensive libraries and headers for different purposes. It also includes a preprocessor that allows developers to define macros and conditional compilation in their code.

One of the key advantages of using gcc is its versatility and extensibility through plugins. It supports several architectural targets and can generate code for different processors and microcontrollers.

gcc is free and open-source software, developed by the GNU Project, under the GNU General Public License (GPL). It has a vast user community and extensive documentation, making it highly reliable and well-supported.

The tool is often used as the default compiler on Unix-like systems and is widely used for the development of various applications, system software, and libraries. It provides developers with advanced features and optimizations while retaining compatibility with older codebases.

Additionally, gcc's modular architecture allows developers to substitute components such as the linker or assembler, making it highly customizable and adaptable to specific needs.

Overall, gcc is a powerful and widely-used command line tool that enables developers to compile and link their source code into executable files, offering flexibility, optimization options, and support for multiple programming languages and platforms.

List of commands for gcc:

  • gcc:tldr:001e5 gcc: Compile multiple source files into an executable.
    $ gcc ${path-to-source1-c path-to-source2-c ---} -o ${path-to-output_executable}
    try on your machine
    explain this command
  • gcc:tldr:28220 gcc: Include libraries from a different path.
    $ gcc ${path-to-source-c} -o ${path-to-output_executable} -I${path-to-header} -L${path-to-library} -l${library_name}
    try on your machine
    explain this command
  • gcc:tldr:a9552 gcc: Show common warnings, debug symbols in output, and optimize without affecting debugging.
    $ gcc ${path-to-source-c} -Wall -g -Og -o ${path-to-output_executable}
    try on your machine
    explain this command
  • gcc:tldr:ebdc5 gcc: Compile source code into Assembler instructions.
    $ gcc -S ${path-to-source-c}
    try on your machine
    explain this command
  • gcc:tldr:f4734 gcc: Compile source code into an object file without linking.
    $ gcc -c ${path-to-source-c}
    try on your machine
    explain this command
  • gprof:tldr:038a0 gprof: Compile binary with gprof information and run it to get `gmon.out`.
    $ gcc -pg ${program-c} && ${--a-out}
    try on your machine
    explain this command
tool overview