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

相关推荐
不染尘.32 分钟前
虚拟网络环境及socket概述
linux·c语言·网络·windows·计算机网络
sinat_363954232 小时前
Canal-deployer1.1.8监听mysql数据变化(windows)
windows·mysql
郭涤生2 小时前
xshell能连上ubuntu24而vscode连接不上_临时关闭 Windows 防火墙
ide·windows·vscode
SJjiemo2 小时前
Stardock Fences:桌面图标管理的“围栏“革命
windows
这儿有一堆花3 小时前
告别 CMD 思维:通往 PowerShell 重构之路
windows
恶猫3 小时前
Win|WinEdt( LaTeX 编辑器),下载及安装教程
windows·编辑器·latex·winedt
巴拉巴拉~~18 小时前
Flutter 通用轮播图组件 BannerWidget:自动播放 + 指示器 + 全场景适配
windows·flutter·microsoft
双河子思18 小时前
Windows API 积累
windows
OliverH-yishuihan20 小时前
在 Windows 上安装 Linux
linux·运维·windows
淼淼76320 小时前
工厂方法模式
开发语言·c++·windows·qt·工厂方法模式