Some samples won't compile

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
jwvdveen
In need of some credit
In need of some credit
Posts: 2
Joined: Sat Nov 21, 2020 11:57 pm

Some samples won't compile

Post by jwvdveen »

I was trying out wxWidgets and installed CodeLite and wanted to compile the samples.
Samples like minimal, splitter and text work right away. However auidemo gives errors like

Code: Select all

 undefined reference to `wxAuiManager::GetPane(wxWindow*)'
And the webview sample gives error like

Code: Select all

undefined reference to `wxStyledTextCtrl::ClearAll()
I've not made any changes to these samples.

Has there something special to be done for these samples?

Platform: Ubuntu 20.04
Compiler: gcc 9.3.0
wx version: 3.0.4
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Some samples won't compile

Post by doublemax »

How exactly did you try to build the samples? They all should build fine from the command line using the provided make files.

If you try to build them in CodeLite, you'll probably have to add the missing libraries to the linker options yourself.
Use the source, Luke!
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Some samples won't compile

Post by DavidHart »

Hi,
If you try to build them in CodeLite, you'll probably have to add the missing libraries to the linker options yourself.
In particular, you should change:

Code: Select all

$(shell wx-config --libs)
to

Code: Select all

$(shell wx-config --libs all)
But the wx samples aren't designed to be configured/built like this. Instead you should do one of two things:
1) Install ubuntu's samples package, wx3.0-examples. It installs to /usr/share/doc/wx-examples/ and has a readme and an 'install' script.
2) If you are using the wx3.0.4 source, the samples/* were configured when you configured your build. Each has a makefile, or there's a global one in samples/

Regards,

David
jwvdveen
In need of some credit
In need of some credit
Posts: 2
Joined: Sat Nov 21, 2020 11:57 pm

Re: Some samples won't compile

Post by jwvdveen »

Thanks to both of you.

Option 2 (from source) worked well, option 1 I will try.
As for CodeLite, even if I try to create a new project with aui, it fails. So I will try

Code: Select all

$(shell wx-config --libs all)
Post Reply