Building wxLua in WSL Ubuntu - wxWidgets libraries not found...

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
rooind
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Jun 04, 2021 10:32 am

Building wxLua in WSL Ubuntu - wxWidgets libraries not found...

Post by rooind » Fri Jun 04, 2021 11:05 am

Hi,

I'm trying to build wxLua (obtained from Github) in WSL Ubuntu. I've already built wxWidgets successfully, and run some of its demos. For completeness, here's what I did to build wxWidgets:

Code: Select all

git clone https://github.com/wxWidgets/wxWidgets
git submodule update --init --recursive
sudo apt-get install build-essential libgtk-3-dev
mkdir buildgtk
cd buildgtk
../configure --with-gtk
make
sudo make install
sudo ldconfig
The libraries are where they should be (I believe):

Code: Select all

EDITED:/usr/local/lib$ ll
total 185752
drwxr-xr-x 1 root root      4096 Jun  4 07:42 ./
drwxr-xr-x 1 root root      4096 Feb 19 23:48 ../
-rw-r--r-- 1 root root  22676056 Jun  4 07:18 libwx_baseu-3.1.so
lrwxrwxrwx 1 root root        24 May 17 13:33 libwx_baseu-3.1.so.6 -> libwx_baseu-3.1.so.6.0.0*
-rwxr-xr-x 1 root root   3279760 May 17 13:33 libwx_baseu-3.1.so.6.0.0*
-rw-r--r-- 1 root root   2886832 Jun  4 07:18 libwx_baseu_net-3.1.so
lrwxrwxrwx 1 root root        28 May 17 13:33 libwx_baseu_net-3.1.so.6 -> libwx_baseu_net-3.1.so.6.0.0*
-rwxr-xr-x 1 root root    375288 May 17 13:33 libwx_baseu_net-3.1.so.6.0.0*
-rw-r--r-- 1 root root    639744 Jun  4 07:37 libwx_baseu_xml-3.1.so
lrwxrwxrwx 1 root root        28 May 17 13:33 libwx_baseu_xml-3.1.so.6 -> libwx_baseu_xml-3.1.so.6.0.0*
-rwxr-xr-x 1 root root     94920 May 17 13:33 libwx_baseu_xml-3.1.so.6.0.0*
-rw-r--r-- 1 root root    307592 Jun  4 07:34 libwx_gtk3u_adv-3.1.so
lrwxrwxrwx 1 root root        28 May 17 13:33 libwx_gtk3u_adv-3.1.so.6 -> libwx_gtk3u_adv-3.1.so.6.0.0*
-rwxr-xr-x 1 root root     15904 May 17 13:33 libwx_gtk3u_adv-3.1.so.6.0.0*
-rw-r--r-- 1 root root   4061312 Jun  4 07:35 libwx_gtk3u_aui-3.1.so
lrwxrwxrwx 1 root root        28 May 17 13:33 libwx_gtk3u_aui-3.1.so.6 -> libwx_gtk3u_aui-3.1.so.6.0.0*
-rwxr-xr-x 1 root root    873464 May 17 13:33 libwx_gtk3u_aui-3.1.so.6.0.0*
-rw-r--r-- 1 root root  77847808 Jun  4 07:34 libwx_gtk3u_core-3.1.so
lrwxrwxrwx 1 root root        29 May 17 13:33 libwx_gtk3u_core-3.1.so.6 -> libwx_gtk3u_core-3.1.so.6.0.0*
-rwxr-xr-x 1 root root  11449896 May 17 13:33 libwx_gtk3u_core-3.1.so.6.0.0*
-rw-r--r-- 1 root root   1139552 Jun  4 07:42 libwx_gtk3u_gl-3.1.so
-rw-r--r-- 1 root root   7418704 Jun  4 07:36 libwx_gtk3u_html-3.1.so
lrwxrwxrwx 1 root root        29 May 17 13:33 libwx_gtk3u_html-3.1.so.6 -> libwx_gtk3u_html-3.1.so.6.0.0*
-rwxr-xr-x 1 root root   1130048 May 17 13:33 libwx_gtk3u_html-3.1.so.6.0.0*
-rw-r--r-- 1 root root   5334144 Jun  4 07:36 libwx_gtk3u_propgrid-3.1.so
lrwxrwxrwx 1 root root        33 May 17 13:33 libwx_gtk3u_propgrid-3.1.so.6 -> libwx_gtk3u_propgrid-3.1.so.6.0.0*
-rwxr-xr-x 1 root root   1410552 May 17 13:33 libwx_gtk3u_propgrid-3.1.so.6.0.0*
-rw-r--r-- 1 root root   1145800 Jun  4 07:42 libwx_gtk3u_qa-3.1.so
lrwxrwxrwx 1 root root        27 May 17 13:33 libwx_gtk3u_qa-3.1.so.6 -> libwx_gtk3u_qa-3.1.so.6.0.0*
-rwxr-xr-x 1 root root    251232 May 17 13:33 libwx_gtk3u_qa-3.1.so.6.0.0*
-rw-r--r-- 1 root root   3492216 Jun  4 07:37 libwx_gtk3u_ribbon-3.1.so
lrwxrwxrwx 1 root root        31 May 17 13:33 libwx_gtk3u_ribbon-3.1.so.6 -> libwx_gtk3u_ribbon-3.1.so.6.0.0*
-rwxr-xr-x 1 root root    706224 May 17 13:33 libwx_gtk3u_ribbon-3.1.so.6.0.0*
-rw-r--r-- 1 root root   7501000 Jun  4 07:38 libwx_gtk3u_richtext-3.1.so
lrwxrwxrwx 1 root root        33 May 17 13:33 libwx_gtk3u_richtext-3.1.so.6 -> libwx_gtk3u_richtext-3.1.so.6.0.0*
-rwxr-xr-x 1 root root   2584032 May 17 13:33 libwx_gtk3u_richtext-3.1.so.6.0.0*
-rw-r--r-- 1 root root  13386736 Jun  4 07:39 libwx_gtk3u_stc-3.1.so
lrwxrwxrwx 1 root root        28 May 17 13:33 libwx_gtk3u_stc-3.1.so.6 -> libwx_gtk3u_stc-3.1.so.6.0.0*
-rwxr-xr-x 1 root root   3269336 May 17 13:33 libwx_gtk3u_stc-3.1.so.6.0.0*
-rw-r--r-- 1 root root  14637400 Jun  4 07:42 libwx_gtk3u_xrc-3.1.so
lrwxrwxrwx 1 root root        28 May 17 13:33 libwx_gtk3u_xrc-3.1.so.6 -> libwx_gtk3u_xrc-3.1.so.6.0.0*
-rwxr-xr-x 1 root root   1781072 May 17 13:33 libwx_gtk3u_xrc-3.1.so.6.0.0*
drwxrwsr-x 1 root staff     4096 Feb 19 23:49 python3.8/
drwxr-xr-x 1 root root      4096 May 17 13:33 wx/
Now, when I try to build wxLua (also obtained from Github) using cmake I get errors. Seems that cmake can't find the wxWidgets library files:

Code: Select all

 ---------------------------------------------------------------------------
* CMake command line options and tips specific to this project 
* 
* In the CMake GUI you can set values and press configure a few times 
* and until there are no more red items, then press generate.
* 
* Usage: cmake -D[OPTION_NAME]=[OPTION_VALUE] /path/to/CMakeLists.txt/
* ---------------------------------------------------------------------------
* -DHELP=TRUE 
*   Show this help message and exit, no files will be generated.
* -DCMAKE_BUILD_TYPE=[Debug, Release, RelWithDebInfo, MinSizeRel] : (Default Debug)
*   Makefiles : You must set the build type to Debug, Release...
*   MSVC GUI  : No need to set this since you can choose it in the GUI.
* -DBUILD_SHARED_LIBS=[TRUE, FALSE] : (Default static in MSW, shared in Linux)
*   Build shared (.DLL or .so) or static (.lib or .a) libraries.
* ---------------------------------------------------------------------------
 
 
*****************************************************************************
* BUILD TYPE:        Debug
* BUILD_SHARED_LIBS: ON
*****************************************************************************
* System is 32-bit FALSE, is 64-bit TRUE
*****************************************************************************
* CMAKE_SOURCE_DIR = /home/anthony/git/wxlua/wxLua
* CMAKE_BINARY_DIR = /home/anthony/git/wxlua/wxLua/test
*****************************************************************************
 
* ---------------------------------------------------------------------------
* wxWidgets library settings :
* 
* Note that ONLY an all shared (DLL) or all static build is supported.
*   I.E. If you choose shared you must link to shared wxWidgets libs.
*   Set -DBUILD_SHARED_LIBS=[TRUE, FALSE] to control shared/static lib.
* 
* Finding wxWidgets for MSW and MSVC
* -DwxWidgets_ROOT_DIR=[path] : (e.g. /path/to/wxWidgets/)
*   Path to the root of the wxWidgets build, must at least set this.
* -DwxWidgets_LIB_DIR=[path] : (e.g. /path/to/wxWidgets/lib/vc_lib/)
*   Path to the wxWidgets lib dir also set this if libs can't be found.
* -DwxWidgets_CONFIGURATION=[configuration] : 
*   Set wxWidgets configuration; e.g. msw, mswu, mswunivu...
*   Where 'u' = unicode and 'd' = debug.
*   MSVC GUI : You need only choose msw, mswu, mswuniv, mswunivu since 
*              release or debug mode is chosen in the GUI.
* -DwxWidgets_COMPONENTS=[...stc;html;adv;core;base or mono] : 
*   For non-monolithic builds choose the wxWidgets libs to link to.
*    xrc;xml;gl;net;media;propgrid;richtext;aui;stc;html;adv;core;base
*   For monolithic builds choose mono and the contribs libs.
*    stc;mono
*   The extra decorations, e.g. wxmsw28ud_adv.lib, will be searched for.
*   Libs that cannot be found will be printed below, please fix/remove
*   them to be able to build this project.
*   You will get compilation/linker errors if wxWidgets is not found.
* 
* Finding wxWidgets for GCC and Unix type systems
* -DwxWidgets_CONFIG_EXECUTABLE=[path/to/wx-config] : 
*   Specify path to wx-config script for GCC and Unix type builds
* ---------------------------------------------------------------------------
 
* Using these wxWidgets components: gl;xrc;xml;net;media;richtext;aui;stc;html;adv;core;base
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES) 
* 
CMake Warning at build/CMakewxAppLib.cmake:325 (message):
  * WARNING: Could not find wxWidgets! Please see help above.
Call Stack (most recent call first):
  CMakeLists.txt:58 (FIND_WXWIDGETS)


* - wxWidgets_VERSION           = 3.1.6 = 3.1.6
* - wxWidgets_COMPONENTS        = gl;xrc;xml;net;media;richtext;aui;stc;html;adv;core;base
* - wxWidgets_INCLUDE_DIRS      = /usr/local/lib/wx/include/gtk3-unicode-3.1;/usr/local/include/wx-3.1
* - wxWidgets_LIBRARY_DIRS      = 
* - wxWidgets_LIBRARIES         = 
* - wxWidgets_CXX_FLAGS         = -pthread
* - wxWidgets_DEFINITIONS       = __WXGTK3__;__WXGTK__
* - wxWidgets_DEFINITIONS_DEBUG = 
* - wxWidgets_PORTNAME          = 
* - wxWidgets_UNIVNAME          = 
* - wxWidgets_UNICODEFLAG       = 
* - wxWidgets_DEBUGFLAG         = 
 WARNING: Unable to find requested wxWidgets component : gl
 WARNING: Unable to find requested wxWidgets component : xrc
 WARNING: Unable to find requested wxWidgets component : xml
 WARNING: Unable to find requested wxWidgets component : net
 WARNING: Unable to find requested wxWidgets component : media
 WARNING: Unable to find requested wxWidgets component : richtext
 WARNING: Unable to find requested wxWidgets component : aui
 WARNING: Unable to find requested wxWidgets component : stc
 WARNING: Unable to find requested wxWidgets component : html
 WARNING: Unable to find requested wxWidgets component : adv
 WARNING: Unable to find requested wxWidgets component : core
 WARNING: Unable to find requested wxWidgets component : base
* 
wxWidgets requested but not found.
* WARNING: Specified wxLuaBinding lib 'webview' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so it will not be compiled.
* WARNING: Specified wxLuaBinding lib 'propgrid' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so it will not be compiled.
* wxLua using built-in Lua 5.1 library
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
* WARNING: Doxygen NOT found, wxLua_doxygen target will not be generated.
Configuring done
I have checked that `/usr/local/bin/wx-config` exists and works. Typing `wx-config --list` comes back with the libraries, so surely nothing more is needed?

I've also tried adding a new entry in cmake-gui: `wxWidgets_LIBRARY_DIRS /usr/local/lib`

Help appreciated.

-- Anthony

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 467
Joined: Fri Nov 03, 2006 2:00 pm

Re: Building wxLua in WSL Ubuntu - wxWidgets libraries not found...

Post by stahta01 » Fri Jun 04, 2021 12:53 pm

I would try a cmake command option of "-DWITH_WX_CONFIG=/path/to/wx-config" and see if it works or exists.

Is the cmake you are using part of WSL? If not, try one that is part of WSL.

Tim S.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 467
Joined: Fri Nov 03, 2006 2:00 pm

Re: Building wxLua in WSL Ubuntu - wxWidgets libraries not found...

Post by stahta01 » Fri Jun 04, 2021 12:59 pm

Try building using "Makefile.wx-config"

Tim S.

rooind
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Jun 04, 2021 10:32 am

Re: Building wxLua in WSL Ubuntu - wxWidgets libraries not found...

Post by rooind » Fri Jun 04, 2021 1:35 pm

I tried using cmake with:

-DWITH_WX_CONFIG=/usr/local/bin/wx-config

-DwxWidgets_CONFIG_EXECUTABLE=/usr/local/bin/wx-config

Neither worked. When you suggest building using "Makefile.wx-config", what exactly is the command (apologies for my naivety)?

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 467
Joined: Fri Nov 03, 2006 2:00 pm

Re: Building wxLua in WSL Ubuntu - wxWidgets libraries not found...

Post by stahta01 » Sat Jun 05, 2021 4:37 am

Please post the link to wxLua you are trying to build!
It was clear in the one I found that that file existed.

Typing "make -f makefile" should normally be the way. Read about the project you are trying to build.

Tim S.

Post Reply