I have create a .lib file that contains my functions.But sometimes i only need to call some of these functions, but when i add the lib file into my projects, it always says there are uncalled functions, how could i get rid of this?
Some compilers/linkers can extract a single function from an object file.
But the "normal" way of writing a modular library is to use lots of source files so the linker gets lots of small object files to pick.
Libraries that contain multiple objects can almost always resolve linkage at that level, some compilers permit an object/section per function. If you have a library created out of one monolithic source file then the linker isn't going to be able to perform dead code elimination. Suggest you break your library source into a one-file-per-function model.
Thanks you two above, it helps a lot :)