2 ms·
> I never understood the concept of "optional" library. Either your program requires a library or it doesn't. The program may have an optional feature that req
by zajio1am 6y ago
> I never understood the concept of "optional" library. Either your program requires a library or it doesn't.
The program may have an optional feature that requires a library. It does not make sense to force everyone to install it, if such feature is used by 1 % of users. Example might be mplayer, where there are common decoding libraries used by everyone and also plenty of obsure decoding libraries.
Even better is to use dlopen() to open the optional library in runtime, to fit in distribution package management paradigm, but this requires much more work than simple option to disable dependency at compile time, and even with it it is useful to have ability do disable optional dependency at compile time to avoid requiement for header files.