Thank you for the response. I looked in src/Gtk/Makefile and indeed the
LDFLAGS did not specify -rdynamic. I just added it and that solved the
issue.

-Russ


On Fri, 26 Feb 2021 at 07:03, Dr. Jürgen Sauermann <mail@jürgen-sauermann.de>
wrote:

> 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
> exported.
>
> Exporting the function name is what -rdynamic does. According to
> *man gcc*:
>
> *       -rdynamic*
> *           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,
> Jürgen
>
>
>
> 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)
> gtk+3.0_3.24.5-1
>
> ---
> $ ./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
> 1
> [I hit CTRL-C twice here]
> 0
> ATTENTION
>       ⎕GTK Blocking
>       ^
> [script is still hung until I kill it from another shell]
> ---
>
>
>

Reply via email to