Jump to content
  • Advertisement
Sign in to follow this  

Help with Dynamically Loaded Shared Libraries

This topic is 3965 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I've introduced a module (plugin) system for my engine so that subsystem implementations can be moved to dynamically loaded shared libraries. This means the engine core knows nothing about the libraries used or implementation details of a given subsystem. It just provides a proxy object that utilizes a pointer to implementation. However, I'm very confused about how loading shared libraries at runtime actually works and what limitations are introduced. For one thing, I've discovered that boost::shared_ptr cannot be used between the host application and a module (I'm guessing the reference counting mechanisms break). One question I have is, is it safe to utilize the same library from different modules (dynamically loaded shared libraries)? For example, my out-of-the-box module implementations uses SDL and OpenGL (among other libraries). Currently, I'm writing and testing two modules: the kernel module and the graphics module. Things seems to be working, but there's one oddity. Occasionally, especially after manipulating the display window, the kernel module does not receive quit events from SDL, and the application must be forcibly terminated (the close button of the window is unresponsive). Could this be a result of using a module in this way, or do I just have a bug somewhere? So, what exactly are some problems or design challenges I can expect with this design? Would it be best to minimize modules, and group an entire implementation into only one dynamically loaded shared library? Any good links would be great. I'm kinda lost here. If it's any help, I'm currently developing on Linux using C++ and g++ and I'm using the ld library to load shared objects until a decent cross platform solution is available (I'm waiting on Boost.Reflection). Thanks!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!