I remember seeing some command that works like this:
g++ main.cpp `some_forgotten_command --some_forgotten_options some_library`
When the command is run, it will substitute the part enclosed by `` with -I/path/to/some_library/include and -L/path/to/some_library/lib/ (or something similar, I don't remember exactly). However I could not remember what some_forgotten_command is.
It's
pkgconforpkg-config(those are two different implementations that do mostly the same thing).pkgconf --libs LibraryNamegives linker flags, andpkgconf --cflags LibraryNamegives compiler flags.You can use both
--libsand--cflagsin the same command (in your specific example, since you do compilation and linking together in a single command, you should use both).And
pkgconf --list-allprints a list of all installed library names.