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

相关推荐
Warren983 小时前
Vue2博客项目笔记(第一天)
java·开发语言·javascript·vue.js·windows·笔记·ecmascript
jie*10 小时前
小杰数据结构——题库——拂衣便欲沧海去,但许明月随吾身
数据结构·windows·python
专注VB编程开发20年12 小时前
用ADO操作EXCEL文件创建表格,删除表格CREATE TABLE,DROP TABLE
服务器·windows·excel·ado·创建表格·删除表格·读写xlsx
梦魇星虹13 小时前
Dell电脑Windows系统更新后声卡驱动无法识别插线耳机问题
windows·电脑
许野平14 小时前
Rust:如何开发Windows 动态链接库 DLL
windows·单片机·rust·dll·动态链接库
FreeDw资源库16 小时前
Windows驱动更新下载工具,电脑硬件设备驱动程序自动安装下载更新,可备份还原!键盘鼠标声卡网卡显卡主板硬盘驱动都可以下载,免费使用的神器!
windows·计算机外设·驱动更新·驱动下载
HaiQinyanAN21 小时前
【学习笔记】FTP库函数学习
windows·笔记·学习
U盘失踪了1 天前
python JSONPath 表达式生成器
linux·windows·python
徐赛俊1 天前
# 自动定时运行Python爬虫脚本教程(Windows任务计划程序)
windows·爬虫·python