Gtk-- 0.10.3: undefined symbols when linking app
- From: Robert_Gasch/PeopleSoft peoplesoft com
- To: gtk-list redhat com
- Subject: Gtk-- 0.10.3: undefined symbols when linking app
- Date: Sat, 26 Dec 1998 12:16:06 +0100
Hi,
ever since the trying to upgrade from Gtk-- 0.10.2 to 0.10.3, some
code which used to work flawlessly, now refuses to link (but compiles
without a hitch). I've tried Gtk-- 0.10.3 with glib/Gtk+1.1.9 and CVS
snapshot 981225 for glib/Gtk+ and Gtk--, but both combinations
suffer from this 'feature'. Attached are the error message and sample code.
I've already run into the -pedantic link issues (and solved them), so
this seems to be something new/unrelated ...
If anybody knows why this is happening, I would appreciate a
helpful hint ...
Thanks
--> Robert
------------------------ error ----------------------
/home/rgasch/src/gtkmmtest> make guitest
g++ -Wall `gtkmm-config --cflags` guitest.cc `gtkmm-config --libs` -o
guitest
/usr/local/lib/libgtkmm-1.1.so: undefined reference to
`Gdk_Window::unref(void)'
/usr/local/lib/libgtkmm-1.1.so: undefined reference to
`Gdk_Window virtual table'
collect2: ld returned 1 exit status
make: *** [guitest] Error 1
/home/rgasch/src/gtkmmtest>
----------------------- source --------------------------
// gui test code
// written by Robert Gasch (Robert_Gasch@peoplesoft.com)
// last modified: 21DEC98: updated to Gtk-- 0.10.2
#include <gtk--.h>
#include <gtk/gtk.h>
class GuiDialogOAC : public Gtk_Window
{
public:
GuiDialogOAC (gfloat value,
gfloat lower, gfloat upper,
gfloat step_increment=1,
gfloat page_increment=10,
gfloat page_size=0);
~GuiDialogOAC ();
void buttonCallbackOK ();
void buttonCallbackApply ();
void buttonCallbackCancel ();
protected:
Gtk_HSeparator d_separator;
Gtk_HSeparator d_separator2;
Gtk_HBox *d_hbox;
Gtk_VBox *d_vbox;
Gtk_Button *d_buttonOK,
*d_buttonApply,
*d_buttonCancel;
Gtk_HScale *d_hScale;
Gtk_Label *d_label;
Gtk_Adjustment *d_adjustment;
};
GuiDialogOAC::GuiDialogOAC(gfloat value, gfloat lower, gfloat upper,
gfloat step_increment,
gfloat page_increment,
gfloat page_size)
: Gtk_Window (GTK_WINDOW_TOPLEVEL)
{
this->set_usize (300, 125);
this->set_title ("testxxxx");
d_vbox = new Gtk_VBox (FALSE, 10);
d_vbox->set_border_width (10);
// create label and add it hbox
d_hbox = new Gtk_HBox (TRUE, 5);
d_label = new Gtk_Label ("The amount ");
d_label->set_justify (GTK_JUSTIFY_LEFT);
d_label->set_padding (0, 5);
d_hbox->pack_start (*d_label, TRUE, TRUE, 10);
d_label->show ();
// add label hbox to main window (v)box
d_vbox->pack_start (*d_hbox, TRUE, TRUE, 0);
d_hbox->show ();
// create scale and add it to hbox
d_hbox = new Gtk_HBox (FALSE, 5);
d_adjustment = new Gtk_Adjustment (value, lower, upper,
step_increment,
page_increment, page_size);
d_hScale = new Gtk_HScale (*d_adjustment);
d_hScale->set_update_policy (GTK_UPDATE_DELAYED);
d_hScale->set_digits (1);
d_hScale->set_draw_value (TRUE);
d_hbox->pack_start (*d_hScale, TRUE, TRUE, 10);
d_hScale->show ();
// add scale hbox to main window (v)box
d_vbox->pack_start (*d_hbox, TRUE, TRUE, 0);
d_hbox->show ();
// create and add new hbox for slim separator
d_hbox = new Gtk_HBox (TRUE, 0);
d_hbox ->pack_start (d_separator, TRUE, TRUE, 0);
d_separator.show ();
d_vbox->pack_start (*d_hbox, TRUE, FALSE, 0);
d_hbox->show ();
// create and add new hbox for wide separator
d_hbox = new Gtk_HBox (TRUE, 0);
d_hbox ->pack_start (d_separator2, TRUE, TRUE, 0);
d_separator2.show ();
d_vbox->pack_start (*d_hbox, TRUE, TRUE, 0);
d_hbox->show ();
// create new hbox and add buttons to it
d_hbox = new Gtk_HBox (FALSE, 5);
d_buttonOK = new Gtk_Button ("OK");
connect_to_method (d_buttonOK->clicked, this, &buttonCallbackOK);
d_hbox->pack_start (*d_buttonOK, TRUE, TRUE, 0);
d_buttonOK->show ();
d_buttonApply = new Gtk_Button ("Apply");
connect_to_method (d_buttonApply->clicked, this,
&buttonCallbackApply);
d_hbox->pack_start (*d_buttonApply, TRUE, TRUE, 0);
d_buttonApply->show ();
d_buttonCancel = new Gtk_Button ("Cancel");
connect_to_method (d_buttonCancel->clicked, this,
&buttonCallbackCancel);
d_hbox->pack_start (*d_buttonCancel, TRUE, TRUE, 0);
d_buttonCancel->show ();
// add new hbox to main (vbox) box
d_vbox->pack_start (*d_hbox, TRUE, TRUE, 0);
d_hbox->show ();
// add main vbox to 'this' and show everything
this->add (d_vbox);
d_vbox->show();
this->show ();
}
GuiDialogOAC::~GuiDialogOAC()
{
printf ("--- GuiDialogOAC\n");
}
void GuiDialogOAC::buttonCallbackOK ()
{
printf ("Callback OK\n");
}
void GuiDialogOAC::buttonCallbackApply ()
{
printf ("Callback Apply\n");
}
void GuiDialogOAC::buttonCallbackCancel ()
{
printf ("Callback Cancel\n");
}
int main (int argc, char *argv[])
{
Gtk_Main gtkMain (&argc, &argv);
GuiDialogOAC *testDialog;
testDialog = new GuiDialogOAC (1.0, 0.0, 100.0, 1, 10, 0);
testDialog->show ();
gtkMain.run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]