From: Aaron koolen on
Hi there.

I'm trying to write a simple plugin system where I have a main app
and then load plugins (bundles) when it runs. Both the app and the
plugins will use wxWidgets and so I've found I have to link each with
the static library. Problem is, when the bundle is loaded with

Boolean ret = ::CFBundleLoadExecutable( ref1 );

I get the wxWidgets core complaining that certain classes already
exists....Here is some error output


[Debug] 11:51:16: ../src/common/object.cpp(242): assert
"sm_classTable->Get(m_className) == NULL" failed: Class
"wxLocaleModule" already in RTTI table - have you used
IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file
twice)?

Application has exited due to signal 5 (SIGTRAP).
[Session started at 2006-02-19 12:07:30 +1300.]
[Debug] 12:07:30: ../src/common/object.cpp(242): assert
"sm_classTable->Get(m_className) == NULL" failed: Class
"wxLocaleModule" already in RTTI table - have you used
IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file
twice)?

Application has exited due to signal 5 (SIGTRAP).
[Session started at 2006-02-19 12:20:05 +1300.]
[Debug] 12:20:06: ../src/common/object.cpp(242): assert
"sm_classTable->Get(m_className) == NULL" failed: Class
"wxThreadModule" already in RTTI table - have you used
IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file
twice)?

Application has exited due to signal 5 (SIGTRAP).
[Session started at 2006-02-19 12:24:34 +1300.]
[Debug] 12:24:35: ../src/common/object.cpp(242): assert
"sm_classTable->Get(m_className) == NULL" failed: Class
"wxThreadModule" already in RTTI table - have you used
IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file
twice)?


Now, I guess this makes sense. I have two bundles (Main app and
plugin) and each is linked with the wxWidgets library. My questions
is, is there a way to fix this. I don't want to link wxWidgets as a
dynamic library and have to distribute it as a separate file if
possible. Maybe there is a way to hold off symbol resolution in the
Plugin until the Plugin is loaded?


Any thoughts?

Thanks
Aaron
From: Vadim Zeitlin on
On Sun, 19 Feb 2006 12:59:00 +1300 Aaron koolen <akoolen(a)paradise.net.nz> wrote:

Ak> Now, I guess this makes sense. I have two bundles (Main app and
Ak> plugin) and each is linked with the wxWidgets library. My questions
Ak> is, is there a way to fix this. I don't want to link wxWidgets as a
Ak> dynamic library and have to distribute it as a separate file if
Ak> possible.

This is the only way which I know to work. Also, especially under OS X,
this is not a problem at all as you distribute a bundle anyhow and it's not
at all a problem to put an extra library into it. In fact it's an awfully
good idea even without taking the link problems into considerations as
you'll save a lot of space if you have more than 0 plugins.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "Stefan Csomor" on
Hi

> number of places where dynamic libraries are looked for. Is
> there a way to have the loader look in another place.
> Preferably the app bundle.

you do that by giving the shared library the special place
@executable_path/../Frameworks/ when linking

have a look at
http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
Tasks/CreatingFrameworks.html#//apple_ref/doc/uid/20002258-106880-BAJJBI
EF

or the xcode projects in WX_2_6_BRANCH or CVS HEAD that have the
'dynamic' target that does precisely this

Best,

stefan


> -----Original Message-----
> From: Aaron koolen [mailto:akoolen(a)paradise.net.nz]
> Sent: Sonntag, 19. Februar 2006 04:46
> To: wx-users(a)lists.wxwidgets.org
> Subject: Re: OSX, Plugins and wxWidgets - multiple symbol
> definition on Plugin load.
>
> Thanks Vadim. I switched my project over to dynamic
> wxWidgets, but when running it looks like the loader looks in
> /usr/local/lib/ libwx_macud-2.6.0.dylib for the library and
> the documentation seems to state that there are only set
>
> Cheers
> Aaron
>
>
> On 19/02/2006, at 2:58 PM, Vadim Zeitlin wrote:
>
> > On Sun, 19 Feb 2006 12:59:00 +1300 Aaron koolen
> > <akoolen(a)paradise.net.nz> wrote:
> >
> > Ak> Now, I guess this makes sense. I have two bundles (Main app and
> > Ak> plugin) and each is linked with the wxWidgets library. My
> > questions
> > Ak> is, is there a way to fix this. I don't want to link wxWidgets
> > as a
> > Ak> dynamic library and have to distribute it as a separate file if
> > Ak> possible.
> >
> > This is the only way which I know to work. Also,
> especially under OS
> > X, this is not a problem at all as you distribute a bundle
> anyhow and
> > it's not at all a problem to put an extra library into it. In fact
> > it's an awfully good idea even without taking the link
> problems into
> > considerations as you'll save a lot of space if you have
> more than 0
> > plugins.
> >
> > Regards,
> > VZ
> >
> > --
> > TT-Solutions: wxWidgets consultancy and technical support
> > http://www.tt-solutions.com/
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

 | 
Pages: 1
Prev: wxThread
Next: Re[2]: Qt vs wxWidgets