In GCC, you can link libraries using the -l flag followed by the library name. What's the point of doing this when you have already #included the header of the library in your code?
In GCC, you can link libraries using the -l flag followed by the library name. What's the point of doing this when you have already #included the header of the library in your code?
Because including a header file, and linking a library, achieve different things.
One is a preprocessor directive, that includes the text of one file in another when constructing a translation unit prior to compilation.
The other links together binary object files to make an executable that includes code compiled from multiple translation units.