Hello every body,
i know how to build a library file.
but now i need a library file that need a .h file for some defines. i have some constant that define pin map of board,i want make a .lib file that exclude one of header files, and when i want use this library file i must include a header file to main.c until project can compile. is it possible? if yes,how?
Regards, Ham Lot
The linker isn't involved in defines, it can only fix up symbols.
Defines are handled by the compiler's pre-processor.
You need to use variables the library can read, or structures/bitvectors which provide configurations/settings.
Thank you,
my problem solved by your guidance.
Say I want to have a library with 50 functions defined in some collection of source files and .h files. I can see how I create that library and include that library in a program.
To reference the functions from the program, I need to create a .h file that is in my program to reference the functions in the library.
So when maintaining the library, the .h file in all of the programs that include the library need to be "maintained", correct?
Thanks!
Al
No. You maintain the interface description as header file as part of the library. Projects using that library get handed both the library file and the header.
That means if you have some .h files within the library that are intended to be internal to the library, they will be exposed, correct? I can easily live with that. There's no perfect solution short of some complex scheme not worth pursuing.