Sign in to follow this  
WireAlbatross

Portability of inheriting from classes of a dynamic library

Recommended Posts

I'm having link errors when subclassing a class of a dynamic library. I have this technique working in Windows. I'm in the middle of writing Mac OS X specific code, and I'm having trouble. Inside my core dynamic lib (.dylib) I have: class GraphicsWindow // An abstract interface class CocoaGraphicsWindow // An abstract base class (partially implements GraphicsWindow). I have a plugin ".bundle" which has OpenGLCocoaGraphicsWindow // Derives from CocoaGraphicsWindow (fully implements GraphicsWindow interface). The plugin links with the core dylib; however, CocoaGraphicsWindow's methods are not found so there are link errors. I'm quite sure symbols are exported from the core dylib because I am able to use other objects in it from the plugin. Is this not possible apart from Windows? I've messed around with __attribute__((visible("default")), and still no luck. I am aware of the limitations of exporting C++ symbols from dynamic libraries, and both the dylib and the plugin bundle are being compiled with the same version of g++. Any help is appreciated.

Share this post


Link to post
Share on other sites
Sorry to reply to my own post, but I've figured out the issue. I just wanted to confirm that this is indeed possible. I just had an old library search path included, so I was trying to link to a two month old build of the core dylib. I love how it took me two days of pulling my hair out to finally realize this =).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this