| ||||||||
Technical Support Support Resources Product Information | GENERAL: MAKING YOUR OWN LIBRARY FILESInformation in this article applies to:
SYMPTOMSI generated a library file (.lib) using the library manager and expected that if I compiled an independent source file and linked it with the library, the linker would take care of only pulling in the functions that were referenced. However, the linker is including all functions in each module from the library and I'm getting linker warnings about these uncalled functions. CAUSELibraries are composed of object modules (which are composed of variables and functions). The smallest unit the linker can manipulate is an object module. So, when you reference a function from a library, the linker includes the entire object module that contains that function. This is only a problem when one object module in your library contains more than one function. RESOLUTIONThe only way to solve this problem is to build your library with one function per source file. Then, when the linker includes a segment from the library, only one function is included. This is the way that most professional libraries are created. FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Saturday, February 05, 2005 | |||||||
| ||||||||