Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8642521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:47:53+00:00 2026-06-12T11:47:53+00:00

I am learning C with the GCC compiler and Geany (Arch Linux, if it

  • 0

I am learning C with the GCC compiler and Geany (Arch Linux, if it makes a difference). However, I am seeing the words compile and build used interchangeably, both in Geany and on the internet. I am asking for clarification that the way I understand the compiling process is correct, because Googling it is just making me more confused.

Say I write a simple helloworld.c file:

#include <stdio.h>
int main(void)
{
    printf("Hello world!");
    return 0;
}

If I run gcc -c helloworld.c, the compiler produces a helloworld.o object file. Geany calls this process compilation and the compiler says Compilation finished successfully.

Now, if I run gcc -o helloworld helloworld.c, the compiler produces an executable file called helloworld and Geany calls it building. However, the compiler again says Compilation finished successfully.

I understand that the -c option produces an object file, and that multiple of these can be linked together with libraries to produce an executable file, but I am confused about which scenario is compilation and which is building.

Furthermore, if I had just one source file in the project, such as a single helloworld.c file, is gcc -o helloworld helloworld.c enough to turn the source code into an executable?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:47:54+00:00Added an answer on June 12, 2026 at 11:47 am

    To answer your 2nd question: yes, gcc -o myprog myprog.c is just fine. So is gcc -o myprog *.c or gcc -o myprog foo.c bar.c baz.c.

    To answer your first question: technically speaking, there’s no word as ‘building’ 🙂 However, the word ‘building’ and ‘compiling’ can be used interchangeably to describe the whole process of producing a final executable from source code.

    In a more precise context you would say there is:

    • preprocessing, when the preprocessor includes header files, expands macros, etc.
    • parsing, where the parser tokenizes the source text and produces a structured data model (a so-called Abstract Syntax Tree) of the program flow.
    • compiling or compilation, when a code generator traverses the AST and generates assembly code from it
    • assembling, when the compiler driver invokes an assembler program which turns the assembly text into binary object code and finally
    • linking or linkage, when the compiler driver invokes a linker to look up symbols in libraries, fill in missing addresses, etc.

    So, strictly speaking, only the 3rd small step is the compilation; furthermore, using the GNU toolchain and make, people tend to call the first four steps (producing an object file from a .c source file) compilation as one.

    More on all this here…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning linux knowledges, when I compile binutils or gcc and install them, they
I learning Objective-C in Linux(Ubuntu), but when i tryed to compile my application that
I'm currently learning how to write shellcode and get a GCC warning assignment of
I am learning C using gcc on fedora 16. I have several questions about
I am learning NASM and am tying to compile this code (which I found
I am learning assembly and making some inlining in my Digital Mars C++ compiler.
As part of learning MIPS assembly, I want to cross compile some C source
I have been learning C++ in school to create small command-line programs. However, I
I wanted to know what is the current standard C compiler being used by
I am learning x86 assembler in order to write a compiler. In particular, I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.