Fwd: Unable to load MSN protocol plugin

Simon Hausmann hausmann at kde.org
Sat Oct 11 11:43:05 BST 2003


On Sat, Oct 11, 2003 at 12:01:27PM +0200, Martijn Klingens wrote:
> On Saturday 11 October 2003 08:55, Andy Fawcett wrote:
> > Right now, I can see that
> >
> > find /usr/local/lib -name '*msn*' -exec grep init_kopete_msn {} \;
> > Binary file /usr/local/lib/libkopete_msn_shared.so.0 matches
> > Binary file /usr/local/lib/libkopete_msn_shared.so matches
> >
> >
> > Should the symbol be in this lib, or in the kopete_msn.so (as seemingly
> > implied in the debug output)?
> 
> Oooh... that might very well be.
> 
> Simon, how exactly does this work? You moved everything, including the 
> KGenericFactory instantiation to the shared lib, but I think Andy is right 
> and the KGF should not be part of the shared lib.
> 
> Right?
> 
> What might help is creating a small file msn_unshared.cpp in the MSN plugin 
> that does
> 
> ----
> #include <kgenericfactory.h>
> 
> #include "msnprotocol.h"
> 
> typedef KGenericFactory<MSNProtocol> MSNProtocolFactory;
> 
> K_EXPORT_COMPONENT_FACTORY( kopete_msn, MSNProtocolFactory( "kopete_msn" ) )
> ----
> 
> Add this file to Makefile.am instead of dummy.cpp, remove the 
> K_EXPORT_COMPONENT_FACTORY from msnprotocol.cpp (but leave the rest in) and 
> rebuild.
> 
> We probably need some msnprotocol_private.h or so to contain the typedef 
> without code duplication to avoid publishing implementation details in the 
> normal header, but that's another issue. First I need to know if it works at 
> all.

Inspired by khtml the attached patch (only build-tested) might be
simpler.

Simon
-------------- next part --------------
Index: Makefile.am
===================================================================
RCS file: /home/kde/kdenetwork/kopete/protocols/msn/Makefile.am,v
retrieving revision 1.55
diff -u -p -b -r1.55 Makefile.am
--- Makefile.am	10 Oct 2003 19:59:40 -0000	1.55
+++ Makefile.am	11 Oct 2003 10:41:09 -0000
@@ -8,6 +8,8 @@ AM_CPPFLAGS = -I$(srcdir)/ui \
 kde_module_LTLIBRARIES = kopete_msn.la
 lib_LTLIBRARIES = libkopete_msn_shared.la
 
+CLEANFILES = dummy.cpp
+
 libkopete_msn_shared_la_SOURCES = msnprotocol.cpp msnaccount.cpp msnaddcontactpage.cpp msncontact.cpp \
 	msnsocket.cpp msnauthsocket.cpp msndispatchsocket.cpp msnmessagemanager.cpp msndebugrawcmddlg.cpp \
 	msnnotifysocket.cpp msnswitchboardsocket.cpp msnfiletransfersocket.cpp msninvitation.cpp msnp2p.cpp sha1.cpp
@@ -21,7 +23,8 @@ kopete_msn_la_LIBADD = libkopete_msn_sha
 kopete_msn_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries)
 
 dummy.cpp:
-	echo > dummy.cpp
+	echo 'extern "C" void *init_libkopete_msn_shared();' > $@
+	echo 'extern "C" void *init_kopete_msn() { return init_libkopete_msn_shared(); }' >> $@
 
 service_DATA = msn.desktop
 servicedir = $(kde_servicesdir)
Index: msnprotocol.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kopete/protocols/msn/msnprotocol.cpp,v
retrieving revision 1.245
diff -u -p -b -r1.245 msnprotocol.cpp
--- msnprotocol.cpp	23 Sep 2003 10:47:50 -0000	1.245
+++ msnprotocol.cpp	11 Oct 2003 10:41:09 -0000
@@ -32,7 +32,7 @@
 
 typedef KGenericFactory<MSNProtocol> MSNProtocolFactory;
 
-K_EXPORT_COMPONENT_FACTORY( kopete_msn, MSNProtocolFactory( "kopete_msn" ) )
+K_EXPORT_COMPONENT_FACTORY( libkopete_msn_shared, MSNProtocolFactory( "kopete_msn" ) )
 
 MSNProtocol *MSNProtocol::s_protocol = 0L;
 


More information about the kde-core-devel mailing list