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

相关推荐
倒流时光三十年16 小时前
MyBatis @MapKey 注解详解
windows·mybatis
生活、追梦者16 小时前
【Windows】 CMD 黑窗口命令大全
windows·命令行·cmd·运维技巧
阿米亚波21 小时前
【C++ STL】std::list
c++·windows·笔记·stl·list
九思x1 天前
Win11电脑更新2099解决
windows
XUHUOJUN2 天前
Windows 2025架构深度分析之Stretch Cluster 延迟工程现实
windows·microsoft·架构·azure local
love530love2 天前
将 ChatCut MCP 插件从 Codex 桌面应用移植到 WorkBuddy —— 完整适配实录
ide·人工智能·windows·视频剪辑·ai agent
works cart2 天前
windows常用命令
windows
浩浩测试一下2 天前
windows 加壳工具代码实现02 - 加壳界面实现MFC
windows·mfc·免杀·加壳器·pe应用
崖边看雾2 天前
记录Python学习——第一章环境安装下载(Windows)
windows·python·学习·pycharm
sukalot2 天前
windows网络适配器驱动开发-NetAdapterCx 接收端缩放(中)
windows·驱动开发