Re: C++ name collisions between plugins
Re: C++ name collisions between plugins
- Subject: Re: C++ name collisions between plugins
- From: Darrin Cardani <email@hidden>
- Date: Thu, 15 Aug 2013 09:41:09 -0700
On Aug 15, 2013, at 7:37 AM, Paul Miller <email@hidden> wrote:
> On 8/15/2013 9:29 AM, Ben Syverson wrote:
>> C++ or Objective C? The Obj C runtime doesn't (can't) distinguish between two classes with the same name, so it's problematic for plugins.
>
> All my code is C++. I have a thin Objective C FxPlug wrapper around it which does has a unique name (I learned that part a long time ago).
>
>> Now I just prefix every class with the reverse domain, product and version number, like this:
>> ComBenSyversonMattebox2Render
>>
>> It's sort of absurd, but it's the only solution to completely avoid collisions.
>
> Yuck. I don't mind having unique names for the Obj C stuff but I have way too much C++ code to do that with.
I can understand that. There should be no issues with C++, since it generally doesn't call things by name at run time the way Objective-C does. Without more info about how your linking and calling things, it's hard to tell you what to do.
Can you describe the various pieces of code and how they interact? How are you linking class Foo into your plug-ins? Is it in a dynamic library (framework, etc.)? Or are you compiling a static library containing Foo into both plug-ins? Or is it even just directly in the source of the plug-ins?
If it's a dynamic library, how do you load the library? dlopen()? Let dyld do it automatically at plug-in load time?
Darrin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden