Introduction

In this lesson, we'll define the three steps needed to use libraries in C++.

To use a library in a file you have to perform three steps. At first, you have to include the header files with the #include statement, so the compiler knows the names of the library. Because the names of the C++ standard library are in the namespace std, you can use them in the second step fully qualified or you have to import them in the global namespace. The third and final step is to specify the libraries for the linker to get an executable. This third step is often not necessary. The three steps are explained in the next couple of lesson.

Get hands-on with 1200+ tech skills courses.