pkulchenko / wxlua

wxlua: Lua bindings for wxWidgets cross-platform GUI toolkit; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and wxWidgets 3.x
306 stars 59 forks source link

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

Closed imfatant closed 3 years ago

imfatant commented 3 years ago

I'm trying to build wxLua (obtained from Github) on WSL Ubuntu using the method described here: https://github.com/pkulchenko/wxlua/blob/master/wxLua/docs/install.md#C4.6

The problem is that despite wxWidgets being installed, and working, CMake is not finding it.

wx-config IS found by CMake (and I checked that it works manually), but CMake still says it can't find wxWidgets.

For reference, here is how I installed wxWidgets:

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):

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/

Here is the output from CMake when trying to build wxLua:

---------------------------------------------------------------------------
* 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

As I've mentioned, I have checked that /usr/local/bin/wx-config exists and works. Typing wx-config --libs all comes back with the libraries:

-L/usr/local/lib -pthread -lwx_gtk3u_xrc-3.1 -lwx_gtk3u_stc-3.1 -lwx_gtk3u_richtext-3.1 -lwx_gtk3u_ribbon-3.1 -lwx_gtk3u_propgrid-3.1 -lwx_gtk3u_aui-3.1 -lwx_gtk3u_gl-3.1 -lwx_gtk3u_html-3.1 -lwx_gtk3u_qa-3.1 -lwx_gtk3u_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1

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

I've also tried adding wxWidgets_CONFIG_EXECUTABLE /usr/local/bin/wx-config

Can you help?

-- Anthony

pkulchenko commented 3 years ago

I'm not sure what's going on, but will try to reproduce this when I get a chance. What version Ubuntu are you using and what version of CMake are you running?

It seems to be failing on VERIFY_WXWIDGETS_COMPONENTS (this is why you get the list of all missing components), although this doesn't seem to be the main issue and the method has the following comment, so it's possible that it's a sort of expected result:

    # Search through the list of components to see what we were able to find.
    # CMake's find_package for wxWidgets fails on missing components and for
    # some reason CMake's find function gives no indication as to why it failed
    # which makes it difficult, if not impossible, to ever 'find' wxWidgets.

    # In Linux using wx-config the WX_{base/core/etc} vars are not set.
    # Mark all libs as not found.

The main failure seems to be in the find_package call that comes with Cmake: find_package( wxWidgets COMPONENTS ${wxWidgets_COMPONENTS}).

Actually, I think I know what may be going on; you run ../configure --with-gtk, but expect gtk3 to be used. Try running ../configure --with-gtk=3 instead.

imfatant commented 3 years ago

Hi,

Thanks for the reply. I tried rebuilding wxWidgets using ../configure --with-gtk=3 but it seems to have made no difference. Still the same errors.

This is Ubuntu 20.04.2 LTS and CMake version 3.16.3.

pkulchenko commented 3 years ago

Interesting. Can you include the output from wx-config after you build wxwidgets with that command?

imfatant commented 3 years ago

Here's the output of wx-config now: wx-config: Available libraries in this build are: xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base

wx-config --libs all: -L/usr/local/lib -pthread -lwx_gtk3u_xrc-3.1 -lwx_gtk3u_stc-3.1 -lwx_gtk3u_richtext-3.1 -lwx_gtk3u_ribbon-3.1 -lwx_gtk3u_propgrid-3.1 -lwx_gtk3u_aui-3.1 -lwx_gtk3u_gl-3.1 -lwx_gtk3u_html-3.1 -lwx_gtk3u_qa-3.1 -lwx_gtk3u_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1

imfatant commented 3 years ago

@pkulchenko

I have got a little further.

One problem appears to have been because of missing dependencies for wxWidgets. So, I rebuilt it after doing:

sudo apt-get install build-essential libreadline-dev
sudo apt-get install libgtk-3-dev libwxgtk-webview3.0-gtk3-dev libwxgtk-media3.0-gtk3-dev
sudo apt-get install libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-0 libgstreamer-plugins-good1.0-dev libgstreamer1.0-0 libgstreamer1.0-0-dbg libgstreamer1.0-dev
sudo apt-get install libwebkit2gtk-4.0-dev

Next, is a small issue with CMake and wxLua. CMakewxAppLib.cmake doesn't handle parsing portname for gtk3, but I managed to fix this by changing the following section:

# wxWidgets GTK1-3 build using configure
    if ("${wxWidgets_PORTNAME}" STREQUAL "")
        string(REGEX MATCH "wx_(gtk[1-3]?)(univ)?(u)?(d)?_core-([0-9].[0-9])" _match_gtk "${wxWidgets_LIBRARIES}")

        if (NOT "${_match_gtk}" STREQUAL "")
            set(wxWidgets_PORTNAME    "${CMAKE_MATCH_1}" )
            set(wxWidgets_UNIVNAME    "${CMAKE_MATCH_2}" )
            set(wxWidgets_UNICODEFLAG "${CMAKE_MATCH_3}" )
            set(wxWidgets_DEBUGFLAG   "${CMAKE_MATCH_4}" )
            #set(wxWidgets_LIB_VERSION "${CMAKE_MATCH_5}" )
        endif()
    endif()

Now CMake builds... almost! Here's CMake's output:

-- * ---------------------------------------------------------------------------
-- * 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: TRUE
-- *****************************************************************************
-- * 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
-- *
-- * Found wxWidgets :
-- * - wxWidgets_VERSION           = 3.0.4 = 3.0.4
-- * - wxWidgets_COMPONENTS        = gl;xrc;xml;net;media;richtext;aui;stc;html;adv;core;base
-- * - wxWidgets_INCLUDE_DIRS      = /usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.0;/usr/include/wx-3.0
-- * - wxWidgets_LIBRARY_DIRS      =
-- * - wxWidgets_LIBRARIES         = -L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_gtk3u_gl-3.0;-lwx_gtk3u_xrc-3.0;-lwx_baseu_xml-3.0;-lwx_baseu_net-3.0;-lwx_gtk3u_media-3.0;-lwx_gtk3u_richtext-3.0;-lwx_gtk3u_aui-3.0;-lwx_gtk3u_stc-3.0;-lwx_gtk3u_html-3.0;-lwx_gtk3u_adv-3.0;-lwx_gtk3u_core-3.0;-lwx_baseu-3.0
-- * - wxWidgets_CXX_FLAGS         = -pthread
-- * - wxWidgets_DEFINITIONS       = _FILE_OFFSET_BITS=64;__WXGTK__
-- * - wxWidgets_DEFINITIONS_DEBUG =
-- * - wxWidgets_PORTNAME          = gtk3
-- * - wxWidgets_UNIVNAME          =
-- * - wxWidgets_UNICODEFLAG       = u
-- * - wxWidgets_DEBUGFLAG         =
-- *
-- * 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
-- Generating done

The odd thing is that the wxWidgets webview and propgrid libraries DO exist, so I don't know what's going on.

EDIT: I edited CMakeLists.txt so that propgrid and webview are specified. wxLua now almost builds:

[ 92%] Building CXX object modules/wxlua/debugger/CMakeFiles/wxLuaDebuggerLib.dir/wxldtarg.cpp.o
[ 92%] Building CXX object modules/wxlua/debugger/CMakeFiles/wxLuaDebuggerLib.dir/wxlsock.cpp.o
[ 93%] Building CXX object modules/wxlua/debugger/CMakeFiles/wxLuaDebuggerLib.dir/wxluadebugger_bind.cpp.o
[ 93%] Linking CXX shared library ../../../lib/Debug/libwxlua_debugger-wx30gtk3ud-3.1.0.0.so
[ 93%] Built target wxLuaDebuggerLib
Scanning dependencies of target wxLua_app
Scanning dependencies of target wxLuaFreeze
Scanning dependencies of target wxLuaCan
[ 94%] Building CXX object apps/wxluafreeze/CMakeFiles/wxLuaFreeze.dir/wxluafreeze.cpp.o
[ 95%] Building CXX object apps/wxlua/CMakeFiles/wxLua_app.dir/wxlua.cpp.o
[ 96%] Building CXX object apps/wxluacan/CMakeFiles/wxLuaCan.dir/cancom.cpp.o
[ 96%] Building CXX object apps/wxluacan/CMakeFiles/wxLuaCan.dir/canlua.cpp.o
[ 97%] Building CXX object apps/wxluacan/CMakeFiles/wxLuaCan.dir/cansim.cpp.o
[ 98%] Building CXX object apps/wxluacan/CMakeFiles/wxLuaCan.dir/wxluacan_bind.cpp.o
[ 99%] Linking CXX executable ../../bin/Debug/wxLuaFreeze
[100%] Linking CXX executable ../../bin/Debug/wxLua
/usr/bin/ld: ../../lib/Debug/libwxlua_bind-wx30gtk3ud-3.1.0.0.so: undefined reference to `wxPluralFormsCalculatorPtr::~wxPluralFormsCalculatorPtr()'
collect2: error: ld returned 1 exit status
make[2]: *** [apps/wxluafreeze/CMakeFiles/wxLuaFreeze.dir/build.make:89: bin/Debug/wxLuaFreeze] Error 1
make[1]: *** [CMakeFiles/Makefile2:610: apps/wxluafreeze/CMakeFiles/wxLuaFreeze.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX executable ../../bin/Debug/wxLuaCan
/usr/bin/ld: ../../lib/Debug/libwxlua_bind-wx30gtk3ud-3.1.0.0.so: undefined reference to `wxPluralFormsCalculatorPtr::~wxPluralFormsCalculatorPtr()'
collect2: error: ld returned 1 exit status
make[2]: *** [apps/wxlua/CMakeFiles/wxLua_app.dir/build.make:89: bin/Debug/wxLua] Error 1
make[1]: *** [CMakeFiles/Makefile2:548: apps/wxlua/CMakeFiles/wxLua_app.dir/all] Error 2
/usr/bin/ld: ../../lib/Debug/libwxlua_bind-wx30gtk3ud-3.1.0.0.so: undefined reference to `wxPluralFormsCalculatorPtr::~wxPluralFormsCalculatorPtr()'
collect2: error: ld returned 1 exit status
make[2]: *** [apps/wxluacan/CMakeFiles/wxLuaCan.dir/build.make:134: bin/Debug/wxLuaCan] Error 1
make[1]: *** [CMakeFiles/Makefile2:579: apps/wxluacan/CMakeFiles/wxLuaCan.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
pkulchenko commented 3 years ago

@imfatant, you may need to add -DCMAKE_CXX_FLAGS="-DwxLUA_USE_wxTranslations=0" option to cmake to fix undefined reference to 'wxPluralFormsCalculatorPtr::~wxPluralFormsCalculatorPtr()' error. See the discussion in #80.

-- 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.

I do see those warning too and they appear to be misleading/harmless.

Can you include a full diff with all your changes?

imfatant commented 3 years ago

Good. It builds fine now. Many thanks for your help.

My recipe:

git clone https://github.com/pkulchenko/wxlua
cd wxlua
cd wxLua
mkdir test
cd test
cmake -DCMAKE_CXX_FLAGS="-DwxLUA_USE_wxTranslations=0" ..  #  do this twice!
make -j8
sudo make install

Is this diff what you require?

anthony@DESKTOP-AJTH7MU:~/git/wxlua/wxLua/build$ diff CMakewxAppLib_old.cmake CMakewxAppLib.cmake 
467c467
<     set(wxWidgets_PORTNAME    "" CACHE STRING "wxWidgets port; 'msw', 'gtk1', 'gtk2'..." FORCE)
---
>     set(wxWidgets_PORTNAME    "" CACHE STRING "wxWidgets port; 'msw', 'gtk1', 'gtk2', 'gtk3'..." FORCE)
524c524
<     # wxWidgets GTK2 build using configure
---
>     # wxWidgets GTK1-3 build using configure
526c526
<         string(REGEX MATCH "wx_(gtk[12]?)(univ)?(u)?(d)?_core-([0-9].[0-9])" _match_gtk "${wxWidgets_LIBRARIES}")
---
>         string(REGEX MATCH "wx_(gtk[1-3]?)(univ)?(u)?(d)?_core-([0-9].[0-9])" _match_gtk "${wxWidgets_LIBRARIES}")
567c567
<     set(wxWidgets_PORTNAME    "${wxWidgets_PORTNAME}"    CACHE STRING "wxWidgets port; 'msw', 'gtk1', 'gtk2'..." FORCE)
---
>     set(wxWidgets_PORTNAME    "${wxWidgets_PORTNAME}"    CACHE STRING "wxWidgets port; 'msw', 'gtk1', 'gtk2', 'gtk3'..." FORCE)
pkulchenko commented 3 years ago

Thank you for the diff! I pushed an update that incorporates these changes.