[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gtk_server "-rdynamic" issue following APL Gtk UI tutorial

From: Dr . Jürgen Sauermann
Subject: Re: Gtk_server "-rdynamic" issue following APL Gtk UI tutorial
Date: Fri, 26 Feb 2021 16:03:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Russtopia,

i have noticed in the past that -rdynamic is somewhat platform
specific - some understand it, some complain.

Some background to GTK:

GTK dynamically links event handlers like those declared in the files
produced by glade. That is in glade (or some other GUI definition file)
you specify the name of a handler as a text string and the binary program
(Gtk_server) that implements the GUI tries to find a (dynamically linked)
function with that name.

This mechanism requires that the function name of the handler is being

Exporting the function name is what -rdynamic does. According to
man gcc:

           Pass the flag -export-dynamic to the ELF linker, on targets that
           support it. This instructs the linker to add all symbols, not only
           used ones, to the dynamic symbol table. This option is needed for
           some uses of "dlopen" or to allow obtaining backtraces from within
           a program.

Normally ./configure does this automatically (and correctly) by some magic
that is beyond what the GNU APL ./configure script can control.

If it doesn't (you can check that if you look at the gcc/ld commands when GNU APL
is built) then you can explicitly add extra flags needed in the compilation (of Gtk_server)
like this:

CXXFLAGS="your-compiler-flags..." ./configure <your configure options...>

or (for linker flags):

LDFLAGS="your-linker-flags..." ./configure <your configure options...>

One of these flags should hopefully do it if you provide the flag needed by your platform.

You should also check with ldd Gtk_server that it has found all the libraries that it needs.

Best Regards,

On 2/25/21 10:05 PM, Russtopia wrote:
I was trying out the GNU APL ⎕GTK Cookbook tutorial and ran into this, which appears to cause the button's 'clicked' handler not to function (hanging the UI and APL itself until I kill the Gtk_server and/or the APL script from another shell).

I looked through the configure script and see some platforms define "export_dynamic_flag_spec=-rdynamic" but I'm not sure if or how to ensure this is defined in my build. Am I doing something dumb? I'm reasonably sure I have the button element named properly and defined the 'clicked' signal in the Glade editor.

Linux x86_64
Devuan Linux (Debian 8.3.0-6)

$ ./my-application.apl
Loading GUI: /home/russtopia/GNUAPL/workspaces/my-application.glade
Top-level widget: window1
See class='GtkWindow' and id='window1'
  See class='GtkGrid' and id='grid1'
    See class='GtkLabel' and id='label1'
    property name='lblEmployee
    End of object class=GtkLabel id=label1 widget-name=lblEmployee

    See class='GtkLabel' and id='label2'
    property name='lblPosition
    End of object class=GtkLabel id=label2 widget-name=lblPosition

    See class='GtkEntry' and id='entry1'
    property name='entryEmployee
    End of object class=GtkEntry id=entry1 widget-name=entryEmployee

    See class='GtkEntry' and id='entry2'
    property name='entryPosition
    End of object class=GtkEntry id=entry2 widget-name=entryPosition

    See class='GtkButton' and id='btnOK'
    property name='OK-button
    End of object class=GtkButton id=btnOK widget-name=OK-button

  End of object class=GtkGrid id=grid1 widget-name=

End of object class=GtkWindow id=window1 widget-name=

map glade id= 'window1' to GObject 0x55da20cb82a0
map glade id= 'grid1' to GObject 0x55da20d43140
map glade id= 'btnOK' to GObject 0x55da20f29180
map glade id= 'entry2' to GObject 0x55da20d948f0
map glade id= 'entry1' to GObject 0x55da20d94640
map glade id= 'label2' to GObject 0x55da20c48590
map glade id= 'label1' to GObject 0x55da20c483f0

(Gtk_server:16920): Gtk-WARNING **: 12:22:32.829: Could not find signal handler 'clicked'.  Did you compile with -rdynamic?
GUI signals connected.
Loading CSS: /home/russtopia/GNUAPL/workspaces/my-application.css
[I hit CTRL-C twice here]
      ⎕GTK Blocking
[script is still hung until I kill it from another shell]

reply via email to

[Prev in Thread] Current Thread [Next in Thread]