Trouble compiling Zerobrane on Linux (Raspberry Pi)

155 views Asked by At

I am trying to compile Zerobrane on a raspberry Pi 4. I ran:

build-linux.sh all

I am able to compile wxWidgets (3.1.4), but when I compile wxLua I get the errors shown below. Anyone know why this would be failing? The wxLua website indicate that wsLua builds against wxWidgets 2.8.x and 2.9.x. Is that the issue? If so, how do I get the build script to build the correct version of wxWidgets?

Scanning dependencies of target wxLuaModule
[  2%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/luamodule.cpp.o
[  4%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxgl_bind.cpp.o
[  6%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxstc_bind.cpp.o
[  8%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxxrc_bind.cpp.o
[  8%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxhtml_bind.cpp.o
[ 10%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxhtml_wxlhtml.cpp.o
[ 13%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxaui_bind.cpp.o
[ 15%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxadv_bind.cpp.o
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp: In function ‘int wxLua_wxAuiToolBar_DestroyTool(lua_State*)’:
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp:2311:27: error: ‘class wxAuiToolBar’ has no member named ‘DestroyTool’; did you mean ‘Destroy’?
     bool returns = (self->DestroyTool(toolId));
                           ^~~~~~~~~~~
                           Destroy
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp: In function ‘int wxLua_wxAuiToolBar_DestroyToolByIndex(lua_State*)’:
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp:2329:27: error: ‘class wxAuiToolBar’ has no member named ‘DestroyToolByIndex’; did you mean ‘FindToolByIndex’?
     bool returns = (self->DestroyToolByIndex(idx));
                           ^~~~~~~~~~~~~~~~~~
                           FindToolByIndex
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp: In function ‘int wxLua_wxAuiManager_AlwaysUsesLiveResize(lua_State*)’:
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp:10513:35: error: ‘AlwaysUsesLiveResize’ is not a member of ‘wxAuiManager’
     bool returns = (wxAuiManager::AlwaysUsesLiveResize());
                                   ^~~~~~~~~~~~~~~~~~~~
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp: In function ‘int wxLua_wxAuiManager_HasLiveResize(lua_State*)’:
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp:10802:27: error: ‘class wxAuiManager’ has no member named ‘HasLiveResize’; did you mean ‘actionResize’?
     bool returns = (self->HasLiveResize());
                           ^~~~~~~~~~~~~
                           actionResize
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp: In function ‘int wxLua_wxAuiDockUIPart_Get_button(lua_State*)’:
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp:12217:29: error: cannot convert ‘wxAuiPaneButton*’ to ‘lua_Number’ {aka ‘double’}
     lua_pushnumber(L, self->button);
                       ~~~~~~^~~~~~
In file included from /home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxlua/wxldefs.h:19,
                 from /home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxlua/wxlstate.h:13,
                 from /home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp:18:
/home/pi/Downloads/ZeroBraneStudio-1.90/build/deps/include/lua.h:161:58: note:   initializing argument 2 of ‘void lua_pushnumber(lua_State*, lua_Number)’
 LUA_API void  (lua_pushnumber) (lua_State *L, lua_Number n);
                                               ~~~~~~~~~~~^
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp: In function ‘int wxLua_wxAuiDockUIPart_Set_button(lua_State*)’:
/home/pi/Downloads/ZeroBraneStudio-1.90/build/wxlua/wxLua/modules/wxbind/src/wxaui_bind.cpp:12379:20: error: invalid conversion from ‘int’ to ‘wxAuiPaneButton*’ [-fpermissive]
     self->button = val;
                    ^~~
[ 17%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxadv_wxladv.cpp.o
[ 17%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxcore_appframe.cpp.o
make[2]: *** [modules/luamodule/CMakeFiles/wxLuaModule.dir/build.make:141: modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxaui_bind.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:343: modules/luamodule/CMakeFiles/wxLuaModule.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Error: failed to build wxLua
2

There are 2 answers

0
Paul Kulchenko On

The version of wxlua that is used by build-linux.sh command doesn't work with wxwidgets 3.1.4. You either need to use the version of wxwidgets that is referenced in that script (which stops at commit 1c754fe7) or use a more recent version of wxlua. You can modify the build script to use the 3.1.0.0 instead of 3.0.0.8:

diff --git a/build/build-linux.sh b/build/build-linux.sh
index b0944b62..c1af45d6 100755
--- a/build/build-linux.sh
+++ b/build/build-linux.sh
@@ -297,7 +297,7 @@ if [ $BUILD_WXLUA ]; then
   git clone "$WXLUA_URL" "$WXLUA_BASENAME" || { echo "Error: failed to get wxlua"; exit 1; }
   cd "$WXLUA_BASENAME/wxLua"
 
-  git checkout v3.0.0.8
+  git checkout v3.1.0.0
 
   cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
     -DCMAKE_BUILD_TYPE=$WXLUABUILD -DBUILD_SHARED_LIBS=FALSE \
0
Inksaver On

There are further problems once the line above is changed. LPEG version needs to be changed, and scintillua 404's

line 65 LPEG_BASENAME="lpeg-1.0.2" #change from lpeg-1.0.0
line 69 LEXLPEG_BASENAME="scintillua_4.4.5-2"
line 70 LEXLPEG_FILENAME="$LEXLPEG_BASENAME.zip"
line 71 LEXLPEG_URL="https://github.com/orbitalquark/scintillua/releases/download/scintillua_4.4.5-2/$LEXLPEG_FILENAME"

This gets much further, but errors on LexLPeg.cxx:33:10: fatal error: DefaultLexer.h: No such file or directory