3 ms·
Linking? Open the Makefile and examine the LDFLAGS variable. There you will usually see the "-L" flag specifying the path to the libraries to be linked, and the
by nineteen999 2y ago
Linking? Open the Makefile and examine the LDFLAGS variable. There you will usually see the "-L" flag specifying the path to the libraries to be linked, and the "-l" flag specifying each library to link. You can specify multiples of both of these. The compiler/linker are usually configured by default to include certain paths automatically (eg. /lib, /usr/lib) so you usually don't need to specify those paths with -L.
It can get a bit more complicated if you want to use DSO's (eg. dynamically loading DLL's at runtime rather than linking at link time), but not a whole lot more.
Compilation? You probably want to understand GNU make pattern rules:
https://www.gnu.org/software/make/manual/html_node/Pattern-Rules.html https://www.gnu.org/software/make/manual/html_node/Pattern-R...
Loading? That's generally the OS kernel's responsibility, as long as you're executing a properly formatted executable that has been compiled and linked correctly you shouldn't have do do anything magic.
There's really not a whole lot to it, but you're correct that the information is not always provided in one place, since not every build environment for every platform uses GNU make. However it really is pervasive in the embedded space and in many OSS C/C++ projects, so it's well worth learning. Most other C/C++ build systems aim to improve on it, but I usually can't be bothered with the additional build dependencies.