main is in function.cc sub.cxx contains functions. g++ -c sub.cxx // create sub.o nm sub.o // check the contents (g++ -o a.exe function.cc sub.o // making a.exe for execution w/o using library) ar r libnew.a sub.o //making library libnew.a g++ -o c.exe function.o -L. -lnew // making executable file c.exe ./c.exe