How does one know the name of the library when linking it with LDFLAGS in a Makefile?
For example:
libxml2.dylib is linked with -lxml2
libz.dylib which is actually named zlib is linked with -lz
Where are those flags specified? How does one look them up?
By convention, you remove the preceding ‘lib’ from the library filename. For a library file called, ‘libmyspecial_library.so’, the corresponding flag is:
This is actually a convention with the gcc compiler. See the gcc man page for more info: