custom widget inheritance

hi,

i have some problem with loading a custom widget in Phab:

my widget is inherited from another custom widget i wrote - the base-class
widget can be loaded by Phab without trouble - but if Phab tries to load
the inherited widget then he complains about an unknown symbol (which is
the base-class i wrote) while loading the dll?

do i have to compile the base-class statically into the shared object of
the inherited class? when I do so Phab crashes without any output :frowning:

where’s the problem??

mirtch <mirtch@gmx.net> wrote:

hi,

i have some problem with loading a custom widget in Phab:

my widget is inherited from another custom widget i wrote - the base-class
widget can be loaded by Phab without trouble - but if Phab tries to load
the inherited widget then he complains about an unknown symbol (which is
the base-class i wrote) while loading the dll?

In general, when you’re linking a shared library, it’s a good idea to
link it with any other shared libraries it depends on:

cc -shared -o libinherited.so $(OBJS) -l basewidget -l ph
^^^^^^^^^^^^^

This way, the base widget’s shared library will automatically get loaded
when PhAB tries lo load the inherited one.

do i have to compile the base-class statically into the shared object of
the inherited class? when I do so Phab crashes without any output > :frowning:

That shouldn’t happen. Did you compile everything -shared?

Wojtek Lerch wrote:

mirtch <> mirtch@gmx.net> > wrote:
hi,

i have some problem with loading a custom widget in Phab:

my widget is inherited from another custom widget i wrote - the base-class
widget can be loaded by Phab without trouble - but if Phab tries to load
the inherited widget then he complains about an unknown symbol (which is
the base-class i wrote) while loading the dll?

In general, when you’re linking a shared library, it’s a good idea to
link it with any other shared libraries it depends on:

cc -shared -o libinherited.so $(OBJS) -l basewidget -l ph
^^^^^^^^^^^^^

This way, the base widget’s shared library will automatically get loaded
when PhAB tries lo load the inherited one.

do i have to compile the base-class statically into the shared object of
the inherited class? when I do so Phab crashes without any output > :frowning:

That shouldn’t happen. Did you compile everything -shared?

  1. if i link my inherited widget against the static lib of my base-class
    widget, then Phab cannot find the base-class symbol :frowning:

  2. if i follow your instructions and link my inherited widget against the
    shared-lib of my base-class widget, then Phab crashes without msg :frowning: even
    though I export all symbols in the shared objects

  3. if i link all of my widgets into one shared lib, then Phab crashes
    also without msg :frowning:

hell! what’s wrong?

regards,
mirtch

Hi Mirtch,

I’m currently having the same problem. Have you tried just a simple app
that tries to create and display your widget? I’m currently in that stage
and it is helping me progress…also, from #qnx IRC (atjulius)

gdb /usr/photon/appbuilder/ab /var/dumps/ap.core

then
bt

tells you where it is crashing in Phab…

Hope this helps
Kevin

“mirtch” <mirtch@gmx.net> wrote in message
news:baa5gc$lh0$1@tiger.openqnx.com…

Wojtek Lerch wrote:

mirtch <> mirtch@gmx.net> > wrote:
hi,

i have some problem with loading a custom widget in Phab:

my widget is inherited from another custom widget i wrote - the
base-class
widget can be loaded by Phab without trouble - but if Phab tries to
load
the inherited widget then he complains about an unknown symbol (which
is
the base-class i wrote) while loading the dll?

In general, when you’re linking a shared library, it’s a good idea to
link it with any other shared libraries it depends on:

cc -shared -o libinherited.so $(OBJS) -l basewidget -l ph
^^^^^^^^^^^^^

This way, the base widget’s shared library will automatically get loaded
when PhAB tries lo load the inherited one.

do i have to compile the base-class statically into the shared object
of
the inherited class? when I do so Phab crashes without any output > :frowning:

That shouldn’t happen. Did you compile everything -shared?

  1. if i link my inherited widget against the static lib of my base-class
    widget, then Phab cannot find the base-class symbol > :frowning:

  2. if i follow your instructions and link my inherited widget against the
    shared-lib of my base-class widget, then Phab crashes without msg > :frowning: > even
    though I export all symbols in the shared objects

  3. if i link all of my widgets into one shared lib, then Phab crashes
    also without msg > :frowning:

hell! what’s wrong?

regards,
mirtch

gdb /usr/photon/appbuilder/ab /var/dumps/ap.core
that would be

gdb /usr/photon/appbuilder/ab /var/dumps/ab.core

Typing a little too fsat!
Kevin



“Kevin Stallard” <kevin@fffflyingrobbbotsss.com> wrote in message
news:babf16$615$1@inn.qnx.com…

Hi Mirtch,

I’m currently having the same problem. Have you tried just a simple app
that tries to create and display your widget? I’m currently in that stage
and it is helping me progress…also, from #qnx IRC (atjulius)

gdb /usr/photon/appbuilder/ab /var/dumps/ap.core

then
bt

tells you where it is crashing in Phab…

Hope this helps
Kevin

“mirtch” <> mirtch@gmx.net> > wrote in message
news:baa5gc$lh0$> 1@tiger.openqnx.com> …
Wojtek Lerch wrote:

mirtch <> mirtch@gmx.net> > wrote:
hi,

i have some problem with loading a custom widget in Phab:

my widget is inherited from another custom widget i wrote - the
base-class
widget can be loaded by Phab without trouble - but if Phab tries to
load
the inherited widget then he complains about an unknown symbol
(which
is
the base-class i wrote) while loading the dll?

In general, when you’re linking a shared library, it’s a good idea to
link it with any other shared libraries it depends on:

cc -shared -o libinherited.so $(OBJS) -l basewidget -l ph
^^^^^^^^^^^^^

This way, the base widget’s shared library will automatically get
loaded
when PhAB tries lo load the inherited one.

do i have to compile the base-class statically into the shared
object
of
the inherited class? when I do so Phab crashes without any output
:frowning:

That shouldn’t happen. Did you compile everything -shared?

  1. if i link my inherited widget against the static lib of my base-class
    widget, then Phab cannot find the base-class symbol > :frowning:

  2. if i follow your instructions and link my inherited widget against
    the
    shared-lib of my base-class widget, then Phab crashes without msg > :frowning:
    even
    though I export all symbols in the shared objects

  3. if i link all of my widgets into one shared lib, then Phab crashes
    also without msg > :frowning:

hell! what’s wrong?

regards,
mirtch

i’ll try it - but first one thing: in case where Phab crashes without msg
i just discovered the problem it’s dlopen() which causes the segmentation
fault, i tried to load the shared lib myself and then it’s crashing. this
occurs everytime the shared-lib contains the other lib

i also wrote a simple app where i link my app against the needed widget
shared-objects and everything works as expected

thanks so far i’ll check it

mirtch


Kevin Stallard wrote:

gdb /usr/photon/appbuilder/ab /var/dumps/ap.core
that would be

gdb /usr/photon/appbuilder/ab /var/dumps/ab.core

Typing a little too fsat!
Kevin



“Kevin Stallard” <> kevin@fffflyingrobbbotsss.com> > wrote in message
news:babf16$615$> 1@inn.qnx.com> …
Hi Mirtch,

I’m currently having the same problem. Have you tried just a simple app
that tries to create and display your widget? I’m currently in that stage
and it is helping me progress…also, from #qnx IRC (atjulius)

gdb /usr/photon/appbuilder/ab /var/dumps/ap.core

then
bt

tells you where it is crashing in Phab…

Hope this helps
Kevin

“mirtch” <> mirtch@gmx.net> > wrote in message
news:baa5gc$lh0$> 1@tiger.openqnx.com> …
Wojtek Lerch wrote:

mirtch <> mirtch@gmx.net> > wrote:
hi,

i have some problem with loading a custom widget in Phab:

my widget is inherited from another custom widget i wrote - the
base-class
widget can be loaded by Phab without trouble - but if Phab tries to
load
the inherited widget then he complains about an unknown symbol
(which
is
the base-class i wrote) while loading the dll?

In general, when you’re linking a shared library, it’s a good idea to
link it with any other shared libraries it depends on:

cc -shared -o libinherited.so $(OBJS) -l basewidget -l ph
^^^^^^^^^^^^^

This way, the base widget’s shared library will automatically get
loaded
when PhAB tries lo load the inherited one.

do i have to compile the base-class statically into the shared
object
of
the inherited class? when I do so Phab crashes without any output
:frowning:

That shouldn’t happen. Did you compile everything -shared?

  1. if i link my inherited widget against the static lib of my base-class
    widget, then Phab cannot find the base-class symbol > :frowning:

  2. if i follow your instructions and link my inherited widget against
    the
    shared-lib of my base-class widget, then Phab crashes without msg > :frowning:
    even
    though I export all symbols in the shared objects

  3. if i link all of my widgets into one shared lib, then Phab crashes
    also without msg > :frowning:

hell! what’s wrong?

regards,
mirtch

hi kevin!

now it works!!! i just re-configured the library-dependancies of my
inherited widget in momentics and after rebuild it worked :slight_smile: but it’s
very important that you link your inherited widget against all required
shared-libs (super-class, …)

it seemed to be an inconsistency between gui and makefile in momentics

regards,
mirtch