摘要: C++代码: 1 /** 2 * @file main.cpp 3 */ 4 #include <cstdlib> 5 #include <iostream> 6 #include <string> 7 #include "config.h" 8 9 #define STRINGIFY(x) #x 阅读全文
posted @ 2022-08-04 21:34 禅元天道 阅读(142) 评论(0) 推荐(0) 编辑
摘要: C++代码同上一篇文章《构建和链接静态库和动态库》,CMakeLists.txt的内容修改如下: 1 # 设置cmake所需的最低版本 2 cmake_minimum_required(VERSION 3.21) 3 # 声明工程名称和工程支持的编程语言 4 project(CmakeTest LA 阅读全文
posted @ 2022-08-04 16:49 禅元天道 阅读(137) 评论(0) 推荐(0) 编辑
摘要: C++代码同上一篇文章《构建和链接静态库和动态库》,CMakeLists.txt的内容修改如下: 1 # 设置cmake所需的最低版本 2 cmake_minimum_required(VERSION 3.21) 3 # 声明工程名称和工程支持的编程语言 4 project(CmakeTest LA 阅读全文
posted @ 2022-08-04 15:50 禅元天道 阅读(1541) 评论(0) 推荐(0) 编辑
摘要: C++源码: 1 /** 2 * @file Message.hpp 3 */ 4 #ifndef MESSAGE_H 5 #define MESSAGE_H 6 7 #include <iosfwd> 8 #include <string> 9 class Message 10 { 11 publ 阅读全文
posted @ 2022-08-04 15:17 禅元天道 阅读(2488) 评论(0) 推荐(0) 编辑
摘要: C++源码: 1 #include <cstdlib> 2 #include <iostream> 3 #include <string> 4 5 std::string say_hello() 6 { 7 return std::string("Hello, CMake world!"); 8 } 阅读全文
posted @ 2022-08-04 14:42 禅元天道 阅读(149) 评论(0) 推荐(0) 编辑