GNOME Bugzilla – Bug 88095
libglade-2.0.pc does not specify "dynamic" option to linker
Last modified: 2006-03-07 00:03:09 UTC
running pkg-config --libs libglade-2.0 gives the following output: -L/gnome/head/INSTALL/lib -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lz -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 and pkg-config --libs libglade gives this: -rdynamic -L/usr/lib -L/usr/X11R6/lib -lglade-gnome -lglade -lxml -lz -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -ldl -lXi -lXext -lX11 -lgnome -lgnomesupport -lesd -laudiofile -lm -ldb-3 -lglib This -rdynamic flag is required for an application to use libglade, but is not specified in v2.0 of the .pc files. It's worth noting that -rdynamic is possibly gcc specific, and other operating systems (Solaris?) may need different linker options.
This is covered in the libglade documentation. First of all, not all libglade using apps want to turn on -export-dynamic and second (only those that use the autoconnect() function). Second, there is no compiler independent flags to turn this on. The relevant portion of the documentation is: <para>If you wish to autoconnect handlers defined in the main executable (not a shared library), you will need to pass a linker flag to export the executable's symbols for dynamic linking. This flag is platform specific, but libtool can take care of this for you. Just add <parameter>-export-dynamic</parameter> argument to your link flags, and libtool will convert it to the correct format.</para>
*** Bug 328443 has been marked as a duplicate of this bug. ***