Signal handler problem while linking
- From: "Tomek Lorek" <tlorek gmail com>
- To: gtkmm-list gnome org
- Subject: Signal handler problem while linking
- Date: Fri, 2 Feb 2007 22:45:27 +0100
Hi there,
I've got another thing that I can't go through: my sources are
compiling properly but the final linking fails with:
addtask.o: In function `AddTask::AddTask(Glib::RefPtr<Gnome::Glade::Xml>)':
addtask.cpp:(.text+0x490): undefined reference to `AddTask::on_ok_clicked()'
addtask.cpp:(.text+0x54a): undefined reference to `AddTask::on_cancel_clicked()'
addtask.cpp:(.text+0x604): undefined reference to
`AddTask::on_open_calendar_clicked()'
My sources are:
addtask.h
=======
#include <libglademm/xml.h>
#include <gtkmm.h>
class AddTask
{
Gtk::Window* m_wWindow;
Gtk::Button* m_wOk;
Gtk::Button* m_wCancel;
Gtk::Button* m_wOpenCalendar;
Gtk::Entry* m_wDate;
Gtk::ComboBoxEntry* m_wTaskTime;
public:
AddTask(Glib::RefPtr<Gnome::Glade::Xml> refXml);
~AddTask();
/* signal handlers */
static void on_ok_clicked();
static void on_cancel_clicked();
static void on_open_calendar_clicked();
};
addtask.cpp
=========
#include <libglademm/xml.h>
#include <sigc++/slot.h>
#include "addtask.h"
AddTask::AddTask(Glib::RefPtr<Gnome::Glade::Xml> refXml)
{
refXml->get_widget("wndMain", m_wWindow);
refXml->get_widget("wOk", m_wOk);
refXml->get_widget("wCancel", m_wCancel);
refXml->get_widget("wOpenCalendar", m_wOpenCalendar);
refXml->get_widget("wDate", m_wDate);
refXml->get_widget("wTaskTime", m_wTaskTime);
if (m_wOk) {
m_wOk->signal_clicked().connect(SigC::slot(&on_ok_clicked));
}
if (m_wCancel) {
m_wCancel->signal_clicked().connect(SigC::slot(&on_cancel_clicked));
}
if (m_wOpenCalendar) {
m_wOpenCalendar->signal_clicked().connect(SigC::slot(&on_open_calendar_clicked));
}
}
I had to make my signal handlers static, because it was impossible to
make a reference to a non-static member.
Can anyone please take a look at it?
Best regards
teel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]