[C] General questions about using libraries
I am still not very clear how to use external libraries in my programs.
Correct me if I'm wrong:
The libraries can be downloaded from the classics or apt-get and they have a name like *- dev or installed directly from source code by "configure/make/make install"
Once installed, the libraries are usually copied in / usr / local / lib and have the extension *. so
When I write my program, I add "#include <headerlibrary.h>" on the top of my code.
When I compile the program with gcc I type "gcc myprog.c -llibraryname"
So far correct?
But the library's header (*. h) should automatically go into /usr/include?
Where the compiler searches for them?
When I distribute my program I have to make sure that you also install the library used, right?
Thanks for yours answers.