Unveiling Linux Static and Dynamic Libraries: Essential Usage Techniques You Must Master

Unveiling Linux Static and Dynamic Libraries: Essential Usage Techniques You Must Master

Linux | Red Hat Certified | IT Technology | Operations Engineer 👇 Join our technical exchange QQ group with a note of 【Public Account】 for faster approval 1. Concept of Libraries A library (Library) is a collection of pre-compiled code (functions, classes, data, etc.) that can be shared and reused by multiple programs. The core … Read more

Building and Linking Dynamic and Static Libraries with CMake Made Simple!

Building and Linking Dynamic and Static Libraries with CMake Made Simple!

Click the blue textFollow the author 1. Introduction In slightly more complex projects, we often encounter situations where we need to build multiple executable files, each potentially composed of different source files. More commonly, the project’s source code is distributed across multiple subdirectories rather than being concentrated in a single directory. ProjectRoot ├── CMakeLists.txt (Top-level … Read more

Using CMake: Static and Dynamic Libraries

Using CMake: Static and Dynamic Libraries

When compiling a new program, we will use third-party compiled library files or library files that we compiled ourselves. Here we will use the static and dynamic libraries that have been compiled previously.1. Using Static LibrariesThe file structure is as follows. Here we have deleted add.c and subtract.c from the src folder, keeping only main.c, … Read more

CMake: Exporting Header Files

CMake: Exporting Header Files

Introduction: In fact, the relevant content of this article has been detailed in the CMake: Detailed Explanation of Static and Dynamic Libraries (Linux/Windows) notes, where it shows that CMake provides a platform-independent way to achieve its functionality. However, the issue of symbol visibility has not been addressed. The best approach regarding symbol visibility is to … Read more