Dang Linker errors

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Dang Linker errors

Post by protocol » Thu Mar 09, 2006 3:29 am

snippet of output:

/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN7wxTimerC2Ev[wxTimer::wxTimer()]+0x17): In function `wxTimer::wxTimer()':
mousewatch.cpp: undefined reference to `vtable for wxTimer'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN7wxTimerC2Ev[wxTimer::wxTimer()]+0x27):mousewatch.cpp: undefined reference to `wxTimer::Init()'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN7wxTimerC2Ev[wxTimer::wxTimer()]+0x3e):mousewatch.cpp: undefined reference to `wxTimerBase::~wxTimerBase()'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN10mouseWatchD1Ev[mouseWatch::~mouseWatch()]+0x19): In function `mouseWatch::~mouseWatch()':
mousewatch.cpp: undefined reference to `wxTimer::Stop()'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN10mouseWatchD1Ev[mouseWatch::~mouseWatch()]+0x2d):mousewatch.cpp: undefined reference to `wxTimer::~wxTimer()'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN10mouseWatchD1Ev[mouseWatch::~mouseWatch()]+0x49):mousewatch.cpp: undefined reference to `wxTimer::~wxTimer()'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN10mouseWatchD0Ev[mouseWatch::~mouseWatch()]+0x19): In function `mouseWatch::~mouseWatch()':
mousewatch.cpp: undefined reference to `wxTimer::Stop()'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN10mouseWatchD0Ev[mouseWatch::~mouseWatch()]+0x2d):mousewatch.cpp: undefined reference to `wxTimer::~wxTimer()'
/tmp/cce0kPDH.o(.gnu.linkonce.t._ZN10mouseWatchD0Ev[mouseWatch::~mouseWatch()]+0x49):mousewatch.cpp: undefined reference to `wxTimer::~wxTimer()'
collect2: ld returned 1 exit status

it plagues all of my wxWidgets compiled at command line

bash# g++ `wx-config --libs --cppflags` QuCursorDlg.cpp QuCursor\ App.cpp mousewatch.cpp -o QuCursor

(I really thinks its the command)

Thanks in advance.
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!

chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris » Fri Mar 10, 2006 11:02 am

Hi,

This is just a shot in the dark:

Those dreaded "undefined reference to vtable" linker errors happen if you have a method declaration without definition in the class.
Check for something like

Code: Select all

foo.h:

class foo{

 void bar();

};
and foo.cpp is missing the "void foo:bar(){...};".
In your case I'd have a close look at mousewatch.cpp/mousewatch.h.

HTH, Chris
this->signature=NULL;

protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol » Fri Mar 10, 2006 6:04 pm

I'll check that out. Thanks for the reply.

But what about the rest of the errors, any ideas would be appreciated.
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!

chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris » Sat Mar 11, 2006 11:18 am

The rest of the errors may very well be subsequent errors because of the missing vtable (and hence no way to call virtuals).
this->signature=NULL;

Post Reply