Xfce Forum

Sub domains
 

You are not logged in.

#1 2012-08-03 12:40:17

jules
Member
Registered: 2012-08-03
Posts: 2

Panel plugin development - problem using GDK functions

I'm trying to develop a panel plugin based on the sample provided, but am having trouble when I need to use GDK-supplied functions.  I've added the following to configure.ac.in:

XDT_CHECK_PACKAGE([GDK], [gdk-2.0], [2.0])

and in my Makefile.am I use the resulting settings:

libcardapio_la_LIBADD = \
	$(LIBXFCE4UTIL_LIBS) \
	$(LIBXFCE4UI_LIBS) \
	$(LIBXFCE4PANEL_LIBS) \
	$(DBUS_LIBS) \
	$(GDK_LIBS)

This results in the GDK libraries being linked to my module:

jules@ubuntu-dev-vm:~/xfce4-cardapio-plugin$ ldd -v /usr/local/lib/xfce4/panel/plugins/libcardapio.so | grep gdk
	libgdk-x11-2.0.so.0 => /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0 (0xb71a4000)
...

and those libraries contain the function I'm trying to use:

jules@ubuntu-dev-vm:~/xfce4-cardapio-plugin$ nm -D /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0| grep gdk_window_get_origin
0003b700 T gdk_window_get_origin

Yet, when I try to load the plugin, it fails:

(process:20835): GLib-WARNING **: (/build/buildd/glib2.0-2.32.3/./glib/gerror.c:390):g_error_new_valist: runtime check failed: (domain != 0)

(process:20835): xfce4-panel-wrapper-CRITICAL **: Wrapper cardapio-24: Failed to open plugin module "/usr/local/lib/xfce4/panel/plugins/libcardapio.so": /usr/local/lib/xfce4/panel/plugins/libcardapio.so: undefined symbol: gdk_get_window_origin.

I'd welcome any suggestions how to fix this, or even just some clue as to what might be going on!

(Or, alternatively, if there's some way I've missed that I can get the screen position of the button my plugin creates without using gdk functions, that would avoid the need for this.)

Last edited by jules (2012-08-03 12:43:00)

Offline

#2 2012-08-05 17:10:36

jeromeg
Moderator
From: France
Registered: 2010-11-11
Posts: 131
Website

Re: Panel plugin development - problem using GDK functions

Hello,

I think it would help if you published your source code somewhere so that we could have a look.

To get hints at what is going on, you can use:

LD_DEBUG=libs ./your_prog

Regards,

Jérôme

Offline

#3 2012-08-14 14:58:04

qwerty12
Member
Registered: 2012-04-18
Posts: 3

Re: Panel plugin development - problem using GDK functions

jules wrote:
jules@ubuntu-dev-vm:~/xfce4-cardapio-plugin$ nm -D /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0| grep gdk_window_get_origin
0003b700 T gdk_window_get_origin
/libcardapio.so: undefined symbol: gdk_get_window_origin.

gdk_get_window_origin != gdk_window_get_origin

Offline

Board footer

Powered by FluxBB