While reading documentation on some library, I saw that some library have some feature, like compiling program using those library more easier, with just typing ‘-something‘ in the GCC argument instead of typing the path to library or using pkg (... -- cflag --clibs).
How can I get the list of those ‘-something‘ for libraries or packages currently installed on my system?
For example, OpenGL flags:
-lGLUT -lGL
They are surely stored in a GCC’s config file when I use the package manager to install new library, or how GCC would know how to use them?
Those libraries are not stored in any configuration file.
If you check the GCC link options you will see an option “-l” which is used to select libraries to link with. What that option does is to look for libraries in a specified path.
If you look in the folder
/usr/libyou will see a lot of files named like/usr/lib/libgtkspell.so.0.0.0. This if for a library named gtkspell. You link with it by using-lgtkspell, the linker will automatically add the other parts when searching for the file.The
pkg-configapplication is good for libraries that need special extra GCC flags, either when compiling (--cflags) or linking (--libs). But the actual flagspkg-configadds to the compilation/linking are just standard GCC flags.