Skip to content
BENIBIX Learn

Executable File

Development⚙️ Compilers & RuntimesCompilation

Also known as Executable, EXE File, .exe, ELF, Mach-O, PE File

A file that holds a program. You can start it and it runs.

Think of it like

It is like a toy that comes already built. You open the box and it is ready to play.

Example

Emma builds her game in C++. The compiler makes game.exe, and her friends run it without any of her source code.

Why it matters

It is how software reaches people who never see the code. It is also why you should only run executables you trust.

Definition

An executable file is a program the computer can start and run. Inside is machine code, or code that a runtime knows how to run. On Windows these files often end in .exe. On macOS and Linux they usually have no ending, and a setting marks them as allowed to run. A compiler or a build tool makes them from source code.

Example code

console
$ gcc hello.c -o hello
$ ./hello
Hello, world!
The compiler makes a file named hello. Then the file runs.
On the top path, the compiler makes an executable. The system runs it as it is.

Common mistake

Thinking an executable runs on any computer. One built for Windows on an Intel chip will not run on a Mac as it is.

Key takeaways

  1. 1
    Ready to run. No build step left to do.
  2. 2
    Built for a system. Each OS and chip needs its own.
  3. 3
    Trust it first. It can do anything you can.

Compare