跨平台 C++动态库插件加载器
我只是想知道使用共享库动态加载插件的跨平台实现的选项是什么。到目前为止,我发现的唯一一个是:
我只是想知道我是否还有其他选择?本质上,我希望能够将插件放入共享对象文件中,并在运行时加载它们,并且我希望以跨平台 C++ 的方式来实现。
I was just wondering what my options were for cross-platform implementations for the dynamic loading of plugins using shared libraries. So far the only one that I have found is:
And I was just wondering if I had other options? Essentially, I want to be able to put plugins in shared object files, and load them at runtime and I wanted to do it in a cross-platform C++ way.
Edit: I found this Dr Dobbs Post from 2007; surely somebody has come up with something more since then.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以查看Boost Extension,尽管它还没有被 Boost 接受。
You could look into Boost Extension, though it has not yet been accepted into Boost.
Qt 有一个很好的插件系统。您应该查看 该页面的第二部分。
Qt has a nice plugin system. You should take a look at the second part of that page.
如果您想要简单且轻量级的东西,请尝试: https://pocoproject.org/docs/package- Foundation.SharedLibrary.html
使用 SharedLibrary 类,需要三行代码来调用 C 共享库中的函数:
If you want something simple and lightweight try: https://pocoproject.org/docs/package-Foundation.SharedLibrary.html
Using the SharedLibrary class it takes three lines to call a function in a C shared library: