I want to create a header file in C and add it to a library. How do I create the header file and add/access it to/from the library.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Some header:
Some c file:
So the contents of “header.h” are available to “file.c”. This assumes they are in the same directory.
Edit: Added include guards. This prevents the header file from being included in the same translation unit twice.