CMake Mastery (5): Comprehensive Guide to add_library – Static and Dynamic Libraries

CMake Mastery (5): Comprehensive Guide to add_library - Static and Dynamic Libraries

Master the Core Logic of Library Building from Compilation Principles to Industrial Practices 1. Essential Differences Between Static and Dynamic Libraries Core Feature Comparison Feature Static Library (<span>.a</span>/<span>.lib</span>) Dynamic Library (<span>.so</span>/<span>.dll</span>) Linking Method Compiled into the executable file at build time Loaded dynamically at runtime Memory Usage Multiple loads of the same library will consume … Read more

CMake Basics: Compiling Static and Dynamic Libraries, Customizing Library Output Paths

CMake Basics: Compiling Static and Dynamic Libraries, Customizing Library Output Paths

1. Generate a static library for third-party useIn Linux, the name of a static library is composed of: lib + library name + .a, where the library name needs to be specified, and lib and .a are generated automatically. The Windows system is similar.Project file structure:CMakeLists.txt # Set the minimum required CMake version to 3.15 … Read more

Implementing Static Library Compilation in Zephyr

Implementing Static Library Compilation in Zephyr

Zephyr has encapsulated a lot of functionality in its build system around CMake, primarily through a series of macros and functions that simplify the declaration of libraries and modules, the addition of source files, the setting of include directories, and linking operations. Below are detailed explanations of some key points: 1.zephyr_library() Macro lFunction This macro … Read more

Master CMake for Building Static and Dynamic Libraries

Master CMake for Building Static and Dynamic Libraries

1. Task Explain the process of building static and dynamic libraries with CMake in a simple and understandable way using examples. Tasks: Create a static library and a dynamic library, providing the HelloFunc function for use in other programs, which outputs the string ‘Hello World!’ to the terminal. Install header files and shared libraries. Write … Read more

Linux System Programming: Creating and Using Static Libraries

Click the above“Mechanical and Electronic Engineering Technology” to follow us In Linux system programming, a Static Library is a compiled code library that contains a collection of multiple compilation units (such as functions and data) that can be shared by multiple programs. Static libraries typically have the file extension .a. Creating a Static Library Compile … Read more

Basics of GCC Compilation

Basics of GCC Compilation

Click on the above “Beginner Learning Vision”, choose to add Star or “Top” Heavyweight content delivered at the first time This article is reprinted from: AI Algorithms and Image Processing Data Preparation ❝ To facilitate demonstration and explanation, here are a few simple files prepared in advance: test.cpp test.h main.cpp The contents of the files … Read more

From Beginner to Expert: Comprehensive Guide to Linux Soft and Hard Links and Dynamic and Static Libraries

From Beginner to Expert: Comprehensive Guide to Linux Soft and Hard Links and Dynamic and Static Libraries

Linux | Red Hat Certified | IT Technology | Operations Engineer 👇1000-person technical exchange QQ group, note [public account] for faster approval Soft and Hard Links Difference between Soft and Hard Links: Soft Link: It is an independent file with its own inode and inode number. Hard Link: It is not an independent file; it … Read more

A Universal Makefile Template for Various Scenarios

A Universal Makefile Template for Various Scenarios

1. Introduction For development on Windows, many IDEs come with integrated compilers, such as Visual Studio, providing a “one-click compile” feature. After coding, you only need one operation to compile, link, and generate the target file. Linux development is different from Windows; typically, the gcc/g++ compiler is used on Linux. If you are developing Linux … Read more

Sharing Common Makefile Templates

Sharing Common Makefile Templates

Original: https://blog.csdn.net/qq_20553613/article/details/90649734 Hello everyone, I am ZhengN. This time I bring you three Makefile templates: compiling executable programs, compiling static libraries, and compiling dynamic libraries. Related past articles: Overview of Common Makefile Basics! 1. Introduction For development on Windows, many IDEs integrate compilers, such as Visual Studio, providing a “one-click compile” feature, where after coding, … Read more

Common Makefile Templates for Linux Development

Common Makefile Templates for Linux Development

Original: https://blog.csdn.net/qq_20553613/article/details/90649734 1. Introduction For development on Windows, many IDEs integrate compilers, such as Visual Studio, which provide a “one-click compile” feature. After coding, a single operation can complete the compilation, linking, and generation of target files. Linux development differs from Windows; typically, the gcc/g++ compiler is used. If developing Linux programs for ARM, the … Read more