Gtk-- ItemFactory linking problems



I'm trying to set up a menu using Gtk-- 0.10.2 (glib/gtk++ 1.1.7) on
Linux/RedHat 5.1, egcs 2.91.60, and have tried do it based upon the
testgtkmm
program. I'm defining the menu without using the GtkItemFactoryEntry
structures
so that I can set up callback's.

With the following code snippet, it compiles but fill not link.

        //
        // Create the bare minimum menu bar
        //
        itemf->create_item("/File", 0, "<Branch>", 0);
        itemf->create_item("/File/Exit", 0, "<Item>",
                ItemFactoryConnector<WindowMain, string>(this,
&itemcallback,
                "File-Exit"));

If I replace the ItemFactoryConnector<>() code with a 0 then it
compiles/links/runs fine (and displays the menu), but I don't have
the callback I need.

The link error messages are:

WindowMain.o: In function `void ItemFactoryConnector<WindowMain,
basic_string<ch
ar, string_char_traits<char>, __default_alloc_template<true, 0> >
>::connectTo<G
tk_MenuItem>(Gtk_MenuItem *, int) const':
WindowMain.o(.void ItemFactoryConnector<WindowMain, basic_string<char,
string_ch
ar_traits<char>, __default_alloc_template<1, 0> >
>::gnu.linkonce.t.connectTo<Gt
k_MenuItem>(Gtk_MenuItem *, int) const+0xa9): undefined reference to
`Gtk_Object
::signal_connect(char const *, void (*)(...), void *)'
WindowMain.o(.void ItemFactoryConnector<WindowMain, basic_string<char,
string_ch
ar_traits<char>, __default_alloc_template<1, 0> >
>::gnu.linkonce.t.connectTo<Gt
k_MenuItem>(Gtk_MenuItem *, int) const+0x149): undefined reference to
`Gtk_Objec
t::signal_connect(char const *, void (*)(...), void *)'
WindowMain.o: In function `void ItemFactoryConnector<WindowMain,
basic_string<ch
ar, string_char_traits<char>, __default_alloc_template<true, 0> >
>::connectTo<G
tk_RadioMenuItem>(Gtk_RadioMenuItem *, int) const':
WindowMain.o(.void ItemFactoryConnector<WindowMain, basic_string<char,
string_ch
ar_traits<char>, __default_alloc_template<1, 0> >
>::gnu.linkonce.t.connectTo<Gt
k_RadioMenuItem>(Gtk_RadioMenuItem *, int) const+0xa9): undefined
reference to `
Gtk_Object::signal_connect(char const *, void (*)(...), void *)'
WindowMain.o(.void ItemFactoryConnector<WindowMain, basic_string<char,
string_ch
ar_traits<char>, __default_alloc_template<1, 0> >
>::gnu.linkonce.t.connectTo<Gt
k_RadioMenuItem>(Gtk_RadioMenuItem *, int) const+0x149): undefined
reference to
`Gtk_Object::signal_connect(char const *, void (*)(...), void *)'
WindowMain.o: In function `void ItemFactoryConnector<WindowMain,
basic_string<ch
ar, string_char_traits<char>, __default_alloc_template<true, 0> >
>::connectTo<G
tk_CheckMenuItem>(Gtk_CheckMenuItem *, int) const':
WindowMain.o(.void ItemFactoryConnector<WindowMain, basic_string<char,
string_ch
ar_traits<char>, __default_alloc_template<1, 0> >
>::gnu.linkonce.t.connectTo<Gt
k_CheckMenuItem>(Gtk_CheckMenuItem *, int) const+0xa9): undefined
reference to `
Gtk_Object::signal_connect(char const *, void (*)(...), void *)'
WindowMain.o(.void ItemFactoryConnector<WindowMain, basic_string<char,
string_ch
ar_traits<char>, __default_alloc_template<1, 0> >
>::gnu.linkonce.t.connectTo<Gt
k_CheckMenuItem>(Gtk_CheckMenuItem *, int) const+0x149): more undefined
referenc
es to `Gtk_Object::signal_connect(char const *, void (*)(...), void *)'
follow
collect2: ld returned 1 exit status

So, what am I doing wrong? It doesn't seem to find
Gtk_Object::signal_connect
when I link it, but testgtkmm compiles/links that line fine with nearly
identical
code (less class name changes, text string changes).

The comment in object.gen_h on the signal_connect function says it is
obsolete,
but it apparently gets used by the ItemFactoryConnector somewhere.



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