[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    kpart, plugin and static object
From:       Cyrille Berger <cberger () cberger ! net>
Date:       2004-02-15 22:33:57
Message-ID: 200402152333.58064.cberger () cberger ! net
[Download RAW message or body]

Hello,
I am trying to use the plugin system that come along with KParts. It's working 
fine, except with static object. I tried to find the answer to my question in 
the mailing list archive, but I found nothing.

For instance, in my KPart, I have a class which contains a static field :
class A { 
	public:
		int i;
};
class B {
	public:
		int getValue() { return B::a::i; };
	private:
		static A* a;
};

The value of the field a is initialized somewhere in the KPart, when I call 
getValue() from the KPart, it's working fine, but if I call getValue() from a 
plugin, it crash because a=0.

So I tried to compile the plugin and the KPart with :  "-shared -fPIC" and 
link with "-shared -Wl", and to link the application  with "-Wl 
--export-dynamic -rdynamic". But then the application will crash 
(segmentation fault) when trying to start. Does anyone has an idea of what I 
have to do ?
-- 
--- Cyrille Berger ---
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic