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

相关推荐
许彰午9 小时前
11_Java集合框架概述
java·windows·python
爱分享软件的学长9 小时前
GitHub CLI 2.92.0 官方版下载(夸克网盘+百度网盘,SHA256校验)
windows·开源软件·软件下载
蜗牛~turbo10 小时前
金蝶云星空 二开得到来源单单据体2数据包
windows·c#·金蝶·dynamicobject
xxxxxue10 小时前
Windows 通过 右键菜单 调用 Python 脚本
开发语言·windows·python·右键菜单
light blue bird10 小时前
支轴事件任务线程执行工序路径的图表组件
前端·jvm·windows
一个人旅程~10 小时前
win11中启用经典win10右键菜单和还原默认win11右键菜单如何操作
windows·经验分享·macos·电脑
Cloud_Shy61810 小时前
解读《Effective Python 3rd Edition》:从练气到老魔(第二章 Item 10 - 12)
c语言·开发语言·网络·人工智能·windows·python·编辑器
devilnumber10 小时前
Java Lambda 分片(分组 / 分区)超详细讲解
windows
阿汤猫6661 天前
基于OpenCode的Harness架构实战验收指南v3.0 (windows系统)
windows·prompt
阿汤猫6661 天前
基于OpenCode的Harness架构实战v2.2(windows系统)
windows·prompt