GTK- tutorial



Greetings,

DISCLAIMER: I hope this is the right mailing list...

	I am trying to learn gtk-- and downloaded a tutorial from the 
gtkmm.sourceforge.net website. I have typed in the second example in which 
you press a button to print "Hello World" in the terminal window. However, 
the code does not compile. Here is the code from the tutorial

// button.cc

#include <libsigc++>
#include <gtk--/button.h>

void hello()
{
    cout << "Hello World" << endl;
}

main()
{
    Gtk::Button button("Hello World");
    button.clicked.connect(slot(&hello));
}


The first error I got was "libsigc++ : no such file or directory". So I went 
to the website and downloaded libsigc++-1.0.1. I ran the configure, make, 
make check and make install with no problems. I then made a symbolic link 
ln -s /usr/include/sigc++-config.h /usr/include/sig++/libsigc++
(because this is what I think a FAQ was trying to tell me, I am not sure). 
Well, now the error (at compile time) is 

button.cc: In function `int main()':
button.cc:18: implicit declaration of function `int slot(...)'
button.cc:18: no matching function for call to 
`Gtk::EmitProxySignal0<void,Gtk::Button,_GtkButton,2,gtk_button_clicked>::connect 
(int)'
/usr/include/gtk--/proxy.h:96: candidates are: class SigC::Connection 
Gtk::ProxySignal0<void,Gtk::Button,_GtkButton,2>::connect(const 
SigC::Slot0<void> &)

The compile command I am issuing is:
g++ button.cc -o button `gtkmm-config --cflags --libs`

I am at a loss for why this example is not compiling correctly. Can anyone 
point me in the right direction?

--jeff




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