main.cpp文件: #include <iostream>#include "utils.h"int main(void) {int a = 1;int b = 2;int c = AddFunc(a, b);std::cout<< c <<std::endl;return 0;} utils.h文件: #pragma onceint AddFunc(int a, int b);
CMake: All problems in computer science can be solved by another level of indirection. cmake会根据cmake-language编写的 CMakeLists.txt 或.cmake后缀文件编译自动生成Makefile CMake使用流程: 在 linux 平台下使用 CMake 生成 Makefile