[Glade-users] signal handler problem



On Wed, 2007-02-14 at 17:59 +0100, salaria113 at yahoo.com wrote:
Thanks for your answer , I try to compile under Linux with the
following commands:

g++ -c -DXTHREADS -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/libglade-2.0 main.cpp

and to link

g++ -o Prova -Wl,--export-dynamic main.o -lgtk-x11-2.0 -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 -lglade-2.0

when i launch ./Prova i have the same error 

When interfacing with the linker, the order of options on the command
line have a significance, you might try reading alot of the gnu ld
manual, or just simply use pkg-config which pretty much always
gets it right.

the linker line would look simply like so:

g++ -o Prova main.o `pkg-config --libs gtk+-2.0 gmodule-2.0`

The gmodule-2.0.pc will ensure that your program is correctly
built with the -Wl,--export-dynamic in the right place.

Cheers,
                    -Tristan

Note: after compiling, look at the output of 
`nm Prova | grep my_signal_callback`, you should get the line:

 0xdeadbeef  T  my_signal_callback

The "T" indicates that "my_signal_callback" did infact appear in the
*text* segment of the resulting binary, thus it is world visible
and the dynamic linker should see it at dlopen() time.






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