The way you try to do this will not work in the long run.
You cannot count on any specific C ++ anti-aliasing / damping algorithm. Different compilers - and even different versions of the same compiler - used different ones. That way you can do this and upgrade to the new version of Xcode and stay in a bad situation.
In addition, C ++ suffers from the Fragile Binary Interface problem. To avoid this, all operations with the internal components of the Grind :: PluginManager instance, from creation to access to a member for deletion, must be performed in the same dynamic library.
Solving these problems is one of the reasons for the Objective-C messaging system and Windows OLE.
A C ++ solution should use a wrapper system.
First, you need to define an opaque pointer type to stand in Grind :: PluginManager *. Cocoa C-language bindings do this a lot.
typedef void* MyGrindPlugInManagerOpaqueHandle;
Secondly, for every operation you want to do in Grind :: PluginManager from outside the dynamic library, you need to use extern "C" to define a function with indestructible C-binding and which takes one of these opaque pointers as an argument. For instance:
#ifdef __cplusplus extern "C" { #endif void foo_wrapper(MyGrindPlugInManagerOpaqueHandle *bar); #ifdef __cplusplus } #endif
Thirdly, the implementation in the C ++ file will look something like this:
void foo_wrapper(MyGrindPlugInManagerOpaqueHandle *bar) { Grind::PluginManager* baz = (Grind::PluginManager*)bar; baz->foo(); }
source share