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?
Thanks you two above, it helps a lot :)
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.
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.
View all questions in Keil forum