During CS 152, we have introduced a few different ways to compile. Here, we'll summarize them and tell what they mean. If all of your code is in one file, called myprogram.c, clang myprogram.c that will create an executable named a.out If you want to name your executable something different, say, myprogram clang -o myprogram myprogram.c Maybe you want to call it mywackyprogram clang -o mywackyprogram myprogram.c Okay, so now you've got this awful bug. It has a segmentation fault or an infinite loop, and you want to figure out where that is happening and be able to inspect the variable values. You need to compile it with extra information for gdb clang myprogram.c -g The -g flag tells it to put in debugging information for a debugger. Now you can use gdb gdb a.out Information on gdb is in another file. Okay, what if you have your code spread among different files? You might have your main in facebook.c, then a bunch of functions implemented in friend.h / friend.c, friends.h / friends.c, link.h / link.c, etc. You have two choices - compile everything separately and link together at the end, or compile everything together. You should be compiling one file as you finish it just to search for small errors, though you won't be able to test it until you have the main. To compile a single file that is only a subset of the program: clang -c link.c This will compile link.c and produce a file called link.o You can do this with all of the individual .c files. Then, at the end, do this: clang facebook.o friend.o friends.o link.o ..... You can also combine this with what you learned above clang -o facebook facebook.o friend.o friends.o link.o ...