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



On Tue, 2004-10-26 at 13:24, Daniel K. O. wrote:

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.

Thanks!

In case someone else also wonders how to do this, the extern thing
worked for me this way:

gui.h:
 extern "C" void myhandler (GtkWidget *, gpointer);

gui.cc:
 extern "C" void myhandler (GtkWidget *widget, gpointer data) {
  ...
 }






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