© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
B. I. Tuleuov, A. B. OspanovaBeginning C++ Compilershttps://doi.org/10.1007/978-1-4842-9563-2_11

11. Using Libraries

Berik I. Tuleuov1   and Ademi B. Ospanova2
(1)
Nur-Sultan, Akmolinskaia, Kazakhstan
(2)
Nur-Sułtan, Kazakhstan
 

In this chapter, we will continue with the example programs of the previous chapter and demonstrate the use of static and dynamic-link libraries, again using the MinGW and Microsoft C/C++ compilers.

11.1 Linking with Static Libraries

The library created in Chapter 10 can now be used in different ways, for example:

g++ twohellos.cpp libhello.a -o twohellos
In this case, the name of the linked library is written in full, with the path (in our ...

Get Beginning C++ Compilers: An Introductory Guide to Microsoft C/C++ and MinGW Compilers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.