Many libraries in CeeLanguage and CeePlusPlus can be defined entirely in header files. Examples include many but not all of the BoostLibraries. It is especially convenient if a library or package can be expressed completely in a CeeCeePlusPlus header file. (.h .hh .hpp .hxx .H), without any accompanying source file (.c .cc .cpp .cxx .C). that must be compiled to an object file (.o .obj) and then linked. This is because many C/C++ UNIX-like build systems have MakeDepend, which can automatically deduce header file dependencies. You add a header, and it automatically gets handled properly by build tools such as make. However, very few people use MakeLinkDepend. Therefore, to use a library which consists of more than a header, you typically need to add the #include "package.hh" and then add package.o or libpackage.a to the Makefile. And then, you may need to add rules to build the object files or libraries. Java is much better behaved in this way. ---- Techniques for creating header only packages: * You must avoid defining data values, objects, or functions, or else you may get multiply defined symbol link errors * Avoid initializing data values. Constructors (inlined) are okay. * File statics are okay (although I hate them) * Inline functions are okay, but beware: an inline function that is too large may be compiled out-of-line, and produce linker multiply definition errors. * Class static functions inside the class definition are okay * Singletons are a good way of creating global objects, and, for that matter, avoid initialization order problems. A C++ idiom for singletons is: class foo_c { ... }; inline foo_c& foo_singleton() { static foo_c global_foo("constructor parms"; return global_foo; } A slightly different flavour makes the singleton a class static function. ---- CategoryCpp