0% found this document useful (0 votes)
45 views1 page

CITS2002 Systems Programming, Lecture 2, p3

C programs are source-code files that need to be compiled into object-code files before they can be executed. A compiler translates the source-code into object-code, while a linker combines these object-code files into an executable program. In some cases, the compilation and linking can occur in a single step, with the compiler automatically invoking the linker.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views1 page

CITS2002 Systems Programming, Lecture 2, p3

C programs are source-code files that need to be compiled into object-code files before they can be executed. A compiler translates the source-code into object-code, while a linker combines these object-code files into an executable program. In some cases, the compilation and linking can occur in a single step, with the compiler automatically invoking the linker.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CITS2002 Systems Programming

← prev 3 next → CITS2002 CITS2002 schedule

Compiling and linking our C programs


C programs are human-readable text files, that we term source-code files.

This makes them very easy to copy, read, and edit on different computers and different operating systems.
C is often described as being portable at the source-code level.

Before we can run (execute) our C programs, we must translate, or compile, their source-code files to files that the operating
system can better manage.
A program known as a compiler translates (compiles) source-code files into object-code files.

Finally, we translate or link one or more object-code files to produce an executable program, often termed a 'binary', an
'executable', or an 'exe' file.
A program known as a linker performs this translation, also linking our object-code file(s) with standard libraries and (optionally)
3rd-party libraries.

Depending on how we invoke the compiler, sometimes we can 'move' straight from the source-code files to the executable
program, all in one step.
In reality the compiler is 'silently' executing the linker program for us, and then removing any unwanted object-files.

CITS2002 Systems Programming, Lecture 2, p3, 26th July 2022.

You might also like