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

相关推荐
yanghuashuiyue11 小时前
windows vue3开发环境搭建
windows
uestc_Venn11 小时前
Windows 11系统出现User Profile Service 服务登录失败。无法加载用户配置文件。 的解决办法
windows·电脑
lkbhua莱克瓦2411 小时前
Java项目——斗地主小游戏(控制台版)
java·开发语言·windows·斗地主项目
zt1985q18 小时前
外部访问 Python 搭建的 HTTP 服务器
运维·服务器·网络·windows·网络协议·http
love530love1 天前
解决 ComfyUI 启动显示 ‘sox‘ 命令未找到错误:从安装到配置的完整指南
人工智能·windows·python·aigc·comfyui·comfyui-manager
deng-c-f1 天前
配置(9):在ubuntu上生成core文件
数据库·windows·ubuntu
人工智能训练1 天前
在Windows系统Docker中使用wsl2、容器、windows文件路径三种不同挂载方式的区别和性能差异
运维·服务器·人工智能·windows·docker·容器·wsl2
娶不到胡一菲的汪大东1 天前
C# 泛型 委托 接口
开发语言·windows·c#
ceclar1231 天前
C#常用集合的使用
开发语言·windows·c#
好学且牛逼的马1 天前
【Java编程思想|15-泛型】
java·windows·python