4e9 Subj : Questions on compiling and using a library To : borland.public.cpp.borlandcpp From : tazzi Date : Mon Dec 27 2004 10:26 am I am using BC5.02 and would like some help in compiling a group of functions into a library. My method now is not efficient, and I would like to improve it. Consider a Utility library "Utils.c" which includes functions f1 and f2. Function f would like to make use of f1, but does not need f2. Code for Utils.c: ------------------------------------------------- int f1 (int x) { return 2*x; } int f2 (int x) { return x**2; } ------------------------------------------------- Right now, I am using the following method to include Utils.c: Code for f.c: ------------------------------------------------- #include "Utils.c" int f(int x) { return f1(x); } ------------------------------------------------- This method produces an executable which includes the unnecessary function f2. Can some one explain how to: 1. Compile Utils.c into a library of functions using the IDE. 2. Add the appropriate nodes to the Project tree so that when function f.c is compiled and linked, it only contains the required function f1? Thanks, tazzi. . 0