Windows下编译RTTR

C++11引入了RTTI、Metaprogramming 等技术,但C++在Reflection编程方面依旧功能有限。在社区上,RTTR则提供了一套C++编写的反射库,补充了C++在Reflection方面的缺陷。

零、环境

|---------------|------------------------------|
| 操作系统 | Windows 11 |
| Visual Studio | Visual Studio Community 2022 |
| CMake | CMake 3.24.2 |
| Doxygen | Doxygen-1.9.8 |

一、下载源码

从GitHub拉取RTTR代码:

复制代码
git clone https://github.com/rttrorg/rttr.git

二、编译

按照下表配置CMake,并完成构建与生成,

|---------------------------------|------------------------------|
| Where is the source code | Windows 11 |
| Where to build the binaries | Visual Studio Community 2022 |
| CMAKE_INSTALL_PREFIX | CMake 3.24.2 |

打开rttr.sln,构建"ALL_BUILD"完成RTTR编译;构建"INSTALL"完成RTTR安装。

网络资料

Reflectionhttps://en.wikipedia.org/wiki/Reflection_%28computer_programming%29

The C++ Extensions for Reflection https://en.cppreference.com/w/cpp/experimental/reflect

RTTRhttps://www.rttr.org/QMetaObjecthttps://doc.qt.io/qt-5/qmetaobject.html

An Introduction to Reflection in C++https://blog.csdn.net/qq_26221775/article/details/138768568?spm=1001.2014.3001.5501

FreeCAD: C++ Generic Factory Method inteface advicehttps://forum.freecad.org/viewtopic.php?p=24221&hilit=BaseClass#p24221

相关推荐
liwulin050631 分钟前
【ROS2】【ESP32S3纯透传方案】ESP32S3+WINDOWS+VMware+ROS2+YDLIDA X导航完整落地方案
windows·stm32·单片机
AxureMost44 分钟前
MTools 0.0.12-beta 全能工具箱
windows·开源软件
beyond阿亮2 小时前
OpenClaw在Windows上接入飞书完整指南
人工智能·windows·ai·openclaw
大强同学4 小时前
MFCMouseEffect 鼠标可视化特效设置与操作教程
windows·鼠标手势
xufengzhu5 小时前
Claude Code Hooks 报错异常处理:解决 Windows 环境下的 jq 命令缺失问题
人工智能·windows·claude code
秋95 小时前
windows中下载并部署mysql-8.0.44-winx64详细过程
windows·mysql·adb
idolao14 小时前
MySQL 5.7 安装教程:详细步骤+自定义安装+命令行客户端配置(Windows版)
数据库·windows·mysql
Dxy123931021615 小时前
Python 根据列表中某字段排序:从基础到进阶
开发语言·windows·python
IronMurphy18 小时前
Java 泛型深度解析:编译期类型擦除机制与 PECS 准则
java·windows·python
fy1216319 小时前
Redis 下载与安装 教程 windows版
数据库·windows·redis