Posts

Showing posts from February, 2021

C++ build process

Image
Introduction Compilation and linking are two basic processes that happen all the time during C++ software development, but oddly enough, they are not well understood by many C++ developers. In general, the build process consists of 4 stages: Before you begin reading this simple article, please remember, initially it was written for self education and it provides a basic explanation of how C++ compiler works. Prerequisite Current test project is on github  and my development setup is: Preprocessing In the first step, the preprocessor essentially performs textual substitution. In reality the preprocessor can do more than this, it can conditionally compile (or ignore) portions of code, and it can expand macros to behave like functions. So the preprocessor does the following: File inclusion , e.g. #include <string> Includes header files for other libraries, classes, etc. The preprocessor actually copies the entire header into your source file. Mac