How do C++ libraries and frameworks add functionality that is not in the standard library?

Viewed 108

Do all C++ libraries and frameworks depend on standard libraries and extend functionality which is already in C++? If not how do they add extra functionality to the language?

For example, I read that the C++ standard library doesn't have functions for audio, so how does OpenAL do it?

If all libraries and frameworks depend on standard libraries, is it possible to do everything without any library, with just the standard library and pure C++?

1 Answers

C++ as a language allows you to write any program that you want. That can include writing a program that does nothing by itself, instead providing functions and classes for others to use. That is called a library.

If you couldn't do audio things without an audio library, how would the audio library be written in the first place?

The use of libraries is generally an economic choice. It is often worthwhile to not write code if you can. At the extreme end, if a particular library author has a NDA with a particular hardware vendor, the effort to reverse-engineer how the hardware is controlled could be gigantic compared to using the library that was written with the confidential knowledge.

Related