i have downloaded a C library from the net with the name libsal.a, to access the APIs in that library i include a header file by name #include in my main.c. i use the following command to compile it :
gcc -L /home/traana/Desktop/opensal-1.0.0/libsal.a main.c
but get the following error when i compile
main.c:3:17: fatal error: sal.h: No such file or directory
compilation terminated.
How do I do this correctly?
When compiling your source, it’s not the library, but the include files that are relevant; so you’ll need to tell gcc where those are, something like
and then link the application with something like