A lecture by Tom Buono on making a C++ library For Tom: 25 extra credit points toward lab grades (up to max of 100% on lab portion of course). If you would like an opportunity to do a lecture for extra credit, let me know, and I'll help you find a topic. We might also do this on an "impromptu" basis, as we did today. e ndianTesters.cc endianTesters.h---->header file, function Prototypes lab04bs2.cc ---> #include "endianTesters.h" include "foo.h" means look in current directory include means look in "system" directories for header files (can add to system directories with the -I flag) #include'ing a .h file means "copy and paste this file into the file at the point where the #include appears" CC -c lab04bs2.cc gives us a .o file lab04bs2.o -c means compile only, don't link .... just make a .o file It is not a fully functioning program on its own. .o file is executable instructions for ONLY the stuff in the .cc file you compiled. It has to be linked together with other .o files (including system libraries like iostream.o and cmath.o, etc. ) to make a complete executable. At link time, symbols (i.e. the names of functions and variable) are turned into actual numeric addresses. Linking Step: Combine all the .o files into one big file.... The .o files for the files that WE made... plus all the .o files that are behind the scenes... CC endianTesters.o lab04bs2.o -o lab04bs2 The name usually is chosen from the .o file that contains the main. The order of the .o files is arbitary.... the only thing that is required is that the -o must come immediately before the name of the executable file. (If you don't put "-o something", the executable ends up in a file named a.out )