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

相关推荐
雾沉川4 小时前
WinRAR 压缩解压软件 功能介绍、硬件适配、横向对比及安装使用教程
windows·winrar·压缩软件
sukalot6 小时前
windows 驱动实例分析系列: wireguard-nt驱动分析-driver篇(一)
windows·驱动开发
百事牛科技7 小时前
Excel部分单元格禁止修改:锁住该锁的,放开该放的
windows·excel
水饺编程7 小时前
第5章,[Win32 章节] :创建、选择和删除画笔
c语言·c++·windows·visual studio
曹牧8 小时前
C#与Java后台交互
java·windows·microsoft·c#
꯭爿꯭巎꯭9 小时前
视频画质修复软件
windows
凯哥Java10 小时前
ChatGPT Windows 客户端突然打不开?提示找不到 Codex CLI,我这样解决了
windows·chatgpt
薛定猫AI1 天前
OpenAI Codex本地完整配置教程|(Windows/Mac/Linux全平台,修复鉴权报错)
linux·windows·macos
w01_02_031 天前
deepseek, harness , windows , 安装。
windows
辻弋2011 天前
手动关服务会自动重启、组策略家庭版用不了——Windows Update Blocker用“禁用+锁定”双保险,让Win10/11自动更新彻底闭嘴
服务器·人工智能·windows·电脑·开源软件