problems with wx-config from codelite's 3.1.3 on ubuntu 20.04

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
unxed
In need of some credit
In need of some credit
Posts: 9
Joined: Mon Dec 09, 2019 8:48 pm

problems with wx-config from codelite's 3.1.3 on ubuntu 20.04

Post by unxed » Mon Aug 03, 2020 2:28 am

I'm trying to build far2l with wx 3.1.3 from codelite. Cmake fails with the following error:

Code: Select all

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
  wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindwxWidgets.cmake:1008 (find_package_handle_standard_args)
  CMakeLists.txt:50 (find_package)
Looks like wx-config does not return anything:

Code: Select all

/home/unxed$ wx-config --libs

          Warning: No config found to match: /usr/bin/wx-config --libs
                   in /usr/lib/x86_64-linux-gnu/wx/config
          If you require this configuration, please install the desired
          library build.  If this is part of an automated configuration
          test and no other errors occur, you may safely ignore it.
          You may use wx-config --list to see all configs available in
          the default prefix.
What can be wrong with it? I'm on Mint 20 (= Ubuntu 20.04). On Mint 19.3 (= Ubuntu 18.04) everything was working like a charm.

Installed packages:

Code: Select all

/home/unxed$ apt list --installed | grep wx

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libwxbase3.1-0-unofficial/stable,now 3.1.3-1.focal amd64 [установлен, автоматически]
libwxbase3.1-dev/stable,now 3.1.3-1.focal amd64 [установлен, автоматически]
libwxgtk3.1-0-unofficial/stable,now 3.1.3-1.focal amd64 [установлен, автоматически]
libwxgtk3.1-dev/stable,now 3.1.3-1.focal amd64 [установлен]
wx-common/stable,now 3.1.3-1.focal amd64 [установлен, автоматически]
wx3.1-headers/stable,now 3.1.3-1.focal amd64 [установлен, автоматически]
Chosen wx-config:

Code: Select all

/home/unxed$ sudo update-alternatives --config wx-config
Есть 2 варианта для альтернативы wx-config (предоставляет /usr/bin/wx-config).

  Выбор   Путь                                                         Приор Состояние
------------------------------------------------------------
* 0            /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.1-unofficial   318       автоматический режим
  1            /usr/lib/x86_64-linux-gnu/wx/config/base-unicode-3.1-unofficial   317       ручной режим
  2            /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.1-unofficial   318       ручной режим

Press <enter> to keep the current choice[*], or type selection number:

DavidHart
Site Admin
Site Admin
Posts: 3998
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: problems with wx-config from codelite's 3.1.3 on ubuntu 20.04

Post by DavidHart » Mon Aug 03, 2020 1:15 pm

Hi,

Thank you for reporting this. Mint is usually happy to run the corresponding ubuntu packages, but clearly this is an exception.

It took me a long time, but I finally realised that it's failing on Mint because of a '/bin/' '/usr/bin/' issue. Mint 20 has its grep and egrep in /bin/ while ubuntu 20.04 keeps them in /usr/bin/. IIUC the grep path is set in the wx-config script when wxWidgets is configured and, as I built the unofficial wx3.1.3 (and 3.1.4) packages on ubuntu, it's set to /usr/bin/.

I can't think of an elegant way to fix this. However a hack that will work is to copy (trying to symlink instead caused an infinite loop) /bin/grep and /bin/egrep to /usr/bin/ . An alternative, and less permanent, fix would be to alter line 92 of the ultimate destination of the wx-config symlink (in your case that's /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.1-unofficial) from

Code: Select all

EGREP="/usr/bin/grep -E"
to

Code: Select all

EGREP="/bin/grep -E" 
Regards,

David

unxed
In need of some credit
In need of some credit
Posts: 9
Joined: Mon Dec 09, 2019 8:48 pm

Re: problems with wx-config from codelite's 3.1.3 on ubuntu 20.04

Post by unxed » Mon Aug 03, 2020 4:25 pm

DavidHart wrote:
Mon Aug 03, 2020 1:15 pm
It took me a long time, but I finally realised that it's failing on Mint because of a '/bin/' '/usr/bin/' issue.
Thanks for spending your time solving this issue, David!

Code: Select all

sudo ln -s /bin/grep /usr/bin/grep
sudo ln -s /bin/egrep /usr/bin/egrep
did the trick for me!

Now I am able to build at least with GTK2 version (package libwxgtk3.1-dev). Unfortunately, for GTK3 version (package libwxgtk3.1unofficial3-dev) cmake still complains that it can not find wx libraries. Not a big problem for me, though, as I can happily stay on GTK2 for now.

unxed
In need of some credit
In need of some credit
Posts: 9
Joined: Mon Dec 09, 2019 8:48 pm

Re: problems with wx-config from codelite's 3.1.3 on ubuntu 20.04

Post by unxed » Mon Aug 03, 2020 6:17 pm

It's just Mint 20, not Mint 20.04 :)
Attachments
Screenshot_2020-08-03 CodeLite IDE Main WxWidgets31Binaries.png
Screenshot_2020-08-03 CodeLite IDE Main WxWidgets31Binaries.png (11.26 KiB) Viewed 247 times

DavidHart
Site Admin
Site Admin
Posts: 3998
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: problems with wx-config from codelite's 3.1.3 on ubuntu 20.04

Post by DavidHart » Mon Aug 03, 2020 6:26 pm

Thanks! Fixed.

Post Reply