undefined reference to `vtable for wxChoicebook'

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
Ellan
Experienced Solver
Experienced Solver
Posts: 57
Joined: Mon May 15, 2017 10:11 am

undefined reference to `vtable for wxChoicebook'

Post by Ellan »

wxWidgets 3.1.0
Ubuntu 14.10
GCC 5.3
when on the function OnInit() I calling
wxRichTextBuffer::AddHandler(new wxRichTextHTMLHandler);
wxRichTextBuffer::AddHandler(new wxRichTextXMLHandler);

I get errors like this: this file propdlg.cpp is the system file, what can I do now ???

Code: Select all

propdlg.cpp:(.text+0x8de): undefined reference to `vtable for wxChoicebook'
propdlg.cpp:(.text+0x8e9): undefined reference to `vtable for wxChoicebook'
propdlg.cpp:(.text+0x900): undefined reference to `wxChoicebook::Create(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
propdlg.cpp:(.text+0xa09): undefined reference to `vtable for wxToolbook'
propdlg.cpp:(.text+0xa14): undefined reference to `vtable for wxToolbook'
propdlg.cpp:(.text+0xa2d): undefined reference to `wxToolbook::Init()'
propdlg.cpp:(.text+0xa54): undefined reference to `wxToolbook::Create(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
propdlg.cpp:(.text+0xb69): undefined reference to `vtable for wxListbook'
propdlg.cpp:(.text+0xb74): undefined reference to `vtable for wxListbook'
propdlg.cpp:(.text+0xb8b): undefined reference to `wxListbook::Create(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
propdlg.cpp:(.text+0xcc5): undefined reference to `vtable for wxTreebook'
propdlg.cpp:(.text+0xcd0): undefined reference to `vtable for wxTreebook'
propdlg.cpp:(.text+0xcdd): undefined reference to `wxTreebook::Init()'
propdlg.cpp:(.text+0xd04): undefined reference to `wxTreebook::Create(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
collect2: error: ld returned 1 exit status
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: undefined reference to `vtable for wxChoicebook'

Post by PB »

My guess would be either wxWidgets builds issues (not much likely, can be ruled out by you successfully building bundled widgets sample) or linking the wrong libraries/linking them in wrong order.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: undefined reference to `vtable for wxChoicebook'

Post by DavidHart »

Hi,

How are you building your program? Using g++ on the command-line, or with a makefile, or...?

However you do so, you should be asking the wx-config script for cxxflags and libs. Please post the details of how you are you calling it.

Regards,

David
Ellan
Experienced Solver
Experienced Solver
Posts: 57
Joined: Mon May 15, 2017 10:11 am

Re: undefined reference to `vtable for wxChoicebook'

Post by Ellan »

According to the following steps:

../configure --disable-shared --enable-unicode
make
sudo make install
sudo ldconfig

but now the options of configure is NULL ,
My program works very well
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: undefined reference to `vtable for wxChoicebook'

Post by DavidHart »

../configure --disable-shared --enable-unicode
I meant the wxWigets wx-config script that you need to call to build your program, not to build wx itself. You might have been missing the wx-config --libs section, or you might have needed to do wx-config --libs all.

But removing the --disable-shared option from your wx build is sensible; it's seldom used in Linux. --enable-unicode is already the default.
My program works very well
Good :) .
Ellan
Experienced Solver
Experienced Solver
Posts: 57
Joined: Mon May 15, 2017 10:11 am

Re: undefined reference to `vtable for wxChoicebook'

Post by Ellan »

:) under code::blocks IDE

best regards!
Thank you!
Thanks

Best Regards

Ellan
Post Reply