Building and Linking Static and Shared Libraries with Makefiles

Library Creation and Linking Basics Consider a C++ project with the following structure: add.h int compute_sum(int x, int y); add.cpp #include "add.h" int compute_sum(int x, int y) { return x + y; } main.cpp #include <iostream> #include "add.h" int main() { std::cout << compute_sum(1, 2) << std: ...

Posted on Sat, 12 Sep 2026 16:40:00 +0000 by MattMan

Practical CMake Configuration Techniques

Configuring RPATH in CMake First, disable the automatic addition of build-time paths to RPATH at the beginning of your CMake configuration: set(CMAKE_SKIP_RPATH TRUE) After declaring a library with add_library but before linking with target_link_libraries, set these properties to enable dependency lookup in relative ../lib or ./lib directories ...

Posted on Mon, 06 Jul 2026 16:04:05 +0000 by songwind

CMake Fundamentals for Building C++ Projects

CMake is a cross-platform build system generator that simplifies the compilation process for multi-language projects. It generates native build scripts (Makefiles, Visual Studio projects, etc.) from platform-independent configuration files. Installation Most Linux distributions include CMake in their package repositories. For Windows or systems ...

Posted on Thu, 18 Jun 2026 17:02:48 +0000 by gamefreak13