# Descent into C 1. Hopefully, you remember how to use the shell and how to browse these documents from last week. If you need to review, just run: $ cat ~/pb152/00/intro.txt The lecture for today, however, starts here: $ cd ~/pb152/02 $ cat intro.txt 2. Today, we will get acquainted with the C compiler, the linker and we will write some very simple C programs. 3. The traditional UNIX name for the C compiler is ‹cc›. On most Linux systems (this one included), the default C compiler is known as ‹gcc› (short for GNU ‹cc› -- this is mainly because you could install ‹gcc› on computers that already had their own system ‹cc›). 4. You can usually run ‹gcc› using the command ‹cc› whenever it is the default compiler. I would actually recommend that you do it this way, unless you require the GNU compiler specifically. Not all modern UNIX systems use ‹gcc› as the default compiler, sometimes for a good reason. 5. You can read the documentation for how to run ‹gcc› using: $ man gcc Unfortunately, on this computer ‹man cc› does not work. 6. The «linker» is available as ‹ld› (probably from Link eDitor, some people think it is from LoaDer, but that's more tenuous). See also ‹man ld›. 7. The linker takes multiple binary artifacts (object files, libraries) and produces a single file which contains an executable program. How this works will be explained in more detail in the lectures. 8. We will not run the linker directly here. This is rarely needed or useful even in the real world. You can continue by looking at ‹hello.c›: $ cat hello.c You can also use ‹vim› or ‹micro› to open it (whichever you normally use), to make it easier to read: $ micro hello.c