Re: libglade and glade_xml_signal_autoconnect() with C++ compiler?



Toni Willberg wrote:

(For whatever reason, don't ask) I have an C++ application (foo.cc) and
I use GTK (not GTKmm) and libglade, and it seems that
glade_xml_signal_autoconnect() isn't working for me. Compiler used was
gcc v3.3.4.

C++ functions use name mangling to enable function overloading. Your "myhandler" function will have another name when it's compiled. You have either to:
* Declare your function as extern "C" to avoid name mangling or
* Use an API call (probably in the "cxxabi.h" header) to mangle your function's name (or check the function name in your binary), and use this mangled name to connect in your .glade file.


Daniel K. O.




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