TreeList link error Topic is solved

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
NoeMurr
Knows some wx things
Knows some wx things
Posts: 32
Joined: Sat Mar 31, 2018 2:26 pm

TreeList link error

Post by NoeMurr »

Hi all,

I'm trying to create a widgets that derive the wxTreeListCtrl under macOS mojave.

I can successfully compile the treelist sample from wxWidgets with the command line and the command wx-config, but when I use cmake the variable wxWidgets_LIBS does not contains the same libraries from wx-config.

wxWidgets_LIBS content:

Code: Select all

-L/usr/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_gl-3.1 -lwx_osx_cocoau_core-3.1 -lwx_baseu-3.1
wx-config --libs output:

Code: Select all

-L/usr/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.1 -lwx_osx_cocoau_html-3.1 -lwx_osx_cocoau_qa-3.1 -lwx_osx_cocoau_adv-3.1 -lwx_osx_cocoau_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
The library that cause the linking error is: -lwx_osx_cocoau_adv-3.1.

Why Cmake does not link it?

Ps The find command in the cmake is:

Code: Select all

find_package(wxWidgets REQUIRED gl core base)
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: TreeList link error

Post by PB »

NoeMurr wrote: Sun Mar 03, 2019 7:41 pm The library that cause the linking error is: -lwx_osx_cocoau_adv-3.1.

Why Cmake does not link it?

Ps The find command in the cmake is:

Code: Select all

find_package(wxWidgets REQUIRED gl core base)
I have never used OSX so I may be missing something but why did you not tell cmake that you need the wxAdvanced library, e.g. with
find_package(wxWidgets REQUIRED gl core base adv)
Which wxWidgets version are you using: your wx-config output still seems to list the wxAdvanced library. This library was removed (merged with wxCore) only since wxWidgets 3.1.2.
NoeMurr
Knows some wx things
Knows some wx things
Posts: 32
Joined: Sat Mar 31, 2018 2:26 pm

Re: TreeList link error

Post by NoeMurr »

thanks!

I'm using version 3.1.1, adding adv to the module list it works.
Post Reply