I have a static library project in Eclipse that was compiled into a .a file. So now how would I use the functions and constants in that library? Would I just put in into my includes:
#include "mylib.a"
I have a static library project in Eclipse that was compiled into a .a file. So now how would I use the functions and constants in that library? Would I just put in into my includes:
#include "mylib.a"
The static library would be included in the linking process, not in the source code. The library should have an associated .h header file containing the function definitions and constants that you would #include in your source code. Something like
#include "mylib.h"
Then you would compile the source and link it with mylib.a to produce the final binary.
Then while building your executable, add the location of the library's header files to your compiler's include path and then link against the static library. As in
gcc -I/Directory path where mylib header files are located/ foo.c bar.c /Directory where mylib archive is located/mylib.a
Here foo.c and bar.c are files containing your code.