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

相关推荐
ceffans29 分钟前
PDF文档中文本解析
c++·windows·pdf
SummerGao.35 分钟前
Windows 快速搭建C++开发环境,安装C++、CMake、QT、Visual Studio、Setup Factory
c++·windows·qt·cmake·visual studio·setup factory
Igallta_8136222 小时前
【小游戏】C++控制台版本俄罗斯轮盘赌
c语言·开发语言·c++·windows·游戏·游戏程序
wave_sky4 小时前
Visual Studio中打开多个项目
ide·windows·visual studio
donglxd5 小时前
防御黑客系列-第一集-电脑登录记录提示和登录远程推送
windows·网络安全·电脑·系统安全
iOS技术狂热者6 小时前
如何通过Windows环境远程控制MusicGPT在线生成高质量AI音乐
人工智能·windows
Zucker n9 小时前
deepseek本地调用
java·服务器·windows
我真不会起名字啊10 小时前
“深入浅出”系列之C++:(8)libevent 库
开发语言·c++·windows
a41324471 天前
亲测Windows部署Ollama+WebUI可视化
windows·ollama·open-webui·deepseek本地化部署
※※冰馨※※1 天前
【C#】无法安装程序包“DotSpatial.Symbology 4.0.656”
windows·microsoft·c#