tboox / ltui

🍖 A cross-platform terminal ui library based on Lua
https://tboox.org
Apache License 2.0
808 stars 49 forks source link

Error - unable to load ltui.lcurses - undefined symbol COLORS #5

Closed mvoltz closed 4 years ago

mvoltz commented 5 years ago

I'm having trouble testing and using ltui. I hope the information below is enough to be helpful.

System: Chromebook with Linux - Acer 514

uname -a output: Linux local.__ 4.19.16-02893-g2cf2c17c8a43 #1 SMP PREEMPT Sat Jan 19 09:52:07 PST 2019 x86_64 GNU/Linux

I have compiled and installed: lua 5.3.5 luarocks 3.0.4

Rocks installed: lcurses 9.0.0-1 (installed) - /usr/local/lib/luarocks/rocks-5.3 ltui 1.3-1 (installed) - /usr/local/lib/luarocks/rocks-5.3

Error output: Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio

local foo = require("ltui") error loading module 'ltui.lcurses' from file '/usr/local/lib/lua/5.3/ltui.so': /usr/local/lib/lua/5.3/ltui.so: undefined symbol: COLORS stack traceback: [C]: in ? [C]: in function 'require' /usr/local/share/lua/5.3/ltui/curses.lua:31: in main chunk [C]: in function 'require' /usr/local/share/lua/5.3/ltui/application.lua:30: in main chunk [C]: in function 'require' /usr/local/share/lua/5.3/ltui.lua:31: in main chunk [C]: in function 'require' stdin:1: in main chunk [C]: in ?

ncurses version: $ dpkg -l | grep curses

libncurses5:amd64 6.0+20161126-1+deb9u2 amd64 shared libraries for terminal handling libncurses5-dev:amd64 6.0+20161126-1+deb9u2 amd64 developer's libraries for ncurses libncursesw5:amd64 6.0+20161126-1+deb9u2 amd64 shared libraries for terminal handling (wide character support) ncurses-base 6.0+20161126-1+deb9u2 all basic terminal type definitions ncurses-bin 6.0+20161126-1+deb9u2 amd64 terminal-related programs and man pages ncurses-term 6.0+20161126-1+deb9u2 all additional terminal type definitions

waruqi commented 5 years ago

/usr/local/lib/lua/5.3/ltui.so: undefined symbol: COLORS

The definition of the COLORS macro was not found in your curses.h

I tried to modify the ltui source code, and I have done compatibility with this problem. You can try to install ltui again through luarocks.

mvoltz commented 5 years ago

Thank you for your help. Unfortunately I'm getting a COLOR_PAIRS error now.

Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio

local foo = require("ltui") error loading module 'ltui.lcurses' from file '/usr/local/lib/lua/5.3/ltui.so': /usr/local/lib/lua/5.3/ltui.so: undefined symbol: COLOR_PAIRS stack traceback: [C]: in ? [C]: in function 'require' /usr/local/share/lua/5.3/ltui/curses.lua:31: in main chunk [C]: in function 'require' /usr/local/share/lua/5.3/ltui/application.lua:30: in main chunk [C]: in function 'require' /usr/local/share/lua/5.3/ltui.lua:31: in main chunk [C]: in function 'require' stdin:1: in main chunk [C]: in ?

On Sat, Mar 16, 2019 at 9:32 PM ruki notifications@github.com wrote:

/usr/local/lib/lua/5.3/ltui.so: undefined symbol: COLORS

The definition of the COLORS macro was not found in your curses.h

I tried to modify the ltui source code, and I have done compatibility with this problem. You can try to install ltui again through luarocks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tboox/ltui/issues/5#issuecomment-473610247, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYziqtfCzaU-7x1am_FTHjltHAKqV3Kks5vXalBgaJpZM4b35WK .

--

waruqi commented 5 years ago
    /usr/local/lib/lua/5.3/ltui.so: undefined symbol: COLOR_PAIRS

I have fixed it. You can reinstall ltui and try it again.

mvoltz commented 5 years ago

If there is anything I can do on my end to help troubleshoot, please let me know. If I can compile ncurses with certain flags set, or compile lcurses, etc.. I'm happy to help.

New error: undefined symbol: winnstr

Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio

local foo = require ("ltui") error loading module 'ltui.lcurses' from file '/usr/local/lib/lua/5.3/ltui.so': /usr/local/lib/lua/5.3/ltui.so: undefined symbol: winnstr stack traceback: [C]: in ? [C]: in function 'require' /usr/local/share/lua/5.3/ltui/curses.lua:31: in main chunk [C]: in function 'require' /usr/local/share/lua/5.3/ltui/application.lua:30: in main chunk [C]: in function 'require' /usr/local/share/lua/5.3/ltui.lua:31: in main chunk [C]: in function 'require' stdin:1: in main chunk [C]: in ?

waruqi commented 5 years ago

You can attempt to use xmake to build ltui and run tests.

$ cd ltui
$ xmake
$ xmake run test dialog
mvoltz commented 5 years ago

I git cloned your code again and followed the instructions. Here is the output:

Script started on Sun 17 Mar 2019 03:13:34 PM UTC markvoltz@local: /ltui$ xmake checking for the architecture ... x86_64 note: try installing these packages (pass -y to skip confirm)? in xmake-repo: -> ncurses 6.1 please input: y (y/n) y => installing ncurses-6.1 .. ok
[ 0%]: compiling.release src/core/lcurses/lcurses.c [100%]: linking.release libltui.so markvoltz@local: /ltui$ xmake run test dialog error: execv(/usr/local/bin/lua tests/dialog.lua) failed(-1)! markvoltz@local: /ltui$ exit

-- I also ran the script using 'lua tests/dialog.lua' --

Script done on Sun 17 Mar 2019 03:14:01 PM UTC markvoltz@local: /ltui$ lua tests/dialog.lua Segmentation fault

I will also try this from another machine that is not a Chromebook. Maybe the results will be different.

waruqi commented 5 years ago

you can use luajit to run tests.

xmake f --luajit=y -c
xmake
luajit tests/dialog.lua
mvoltz commented 5 years ago

That's better. See below. The odd characters may have something to do with the ChromeOS terminal program. I can look into that. Thank you for your help.

lqmain dialogqk

xThe project focuses on making development and building easier and provides many features (.e.g package, install, plugin, macro, action, option, task ...), so that ax xny developer can quickly pick it up and enjoy the productivity boost when developing and building project. x xlqkx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx lqk

          xx

xx xhello ltui! ( https://tboox.org) x xx xx xA cross-platform terminal ui library based on x xx xx xLua x xx xx x x xx xx x < Yes > < No > x xx xx mqj

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xx

          xx

xmqjx

x

          x

x < Tips > < Input

          < Help >                < Quit >

x mqj

On Sun, Mar 17, 2019 at 5:30 PM ruki notifications@github.com wrote:

you can use luajit to run tests.

xmake f --luajit=y -cxmakeluajit tests/dialog.lua

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tboox/ltui/issues/5#issuecomment-473721639, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYzipFvzWgqAmQq5ZG8Ksui4noZ06S9ks5vXsH-gaJpZM4b35WK .

--

waruqi commented 5 years ago

? Can you add -v -D arguments to xmake and give me the full error log?

xmake f --luajit=y -c -v -D
xmake -v -D
luajit tests/dialog.lua
mvoltz commented 5 years ago

here you go. attached.

On Sun, Mar 17, 2019 at 9:31 PM ruki notifications@github.com wrote:

? Can you add -v -D arguments to xmake and give me the full error log?

xmake f --luajit=y -c -v -Dxmake -v -Dluajit tests/dialog.lua

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tboox/ltui/issues/5#issuecomment-473747821, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYzikkIKAEqSVbtJ76jSTMpkVijFnayks5vXvqYgaJpZM4b35WK .

--

waruqi commented 5 years ago

? I didn't see anything.

mvoltz commented 5 years ago

here it is in text. I don't know how to get rid of the escape codes.

---luajit output

checking for the architecture ... x86_64 [0mchecking for the unzip ... [38;5;2m/usr/bin/unzip [0m [0mchecking for the git ... [38;5;2m/usr/bin/git [0m [0mchecking for the gzip ... [38;5;2m/bin/gzip [0m [0mchecking for the tar ... [38;5;2m/bin/tar [0m [0mchecking for the ping ... [38;5;2m/bin/ping [0m pinging for the host(gitlab.com) ... 189 ms pinging for the host(github.com) ... 65 ms pinging for the host(gitee.com) ... 304 ms finding luajit from xmake .. [0mchecking for the xmake::luajit ... [38;5;2m2.0.5 [0m

{ links = { luajit } , linkdirs = { /home/markvoltz/.config/.xmake/prefix/linux/x86_64/release/lib } , version = 2.0.5 , includedirs = {

/home/markvoltz/.config/.xmake/prefix/linux/x86_64/release/include/luajit } } finding ncurses from xmake .. [0mchecking for the xmake::ncurses ... [38;5;2m6.1 [0m

{ links = { ncurses , form , panel , menu } , linkdirs = { /home/markvoltz/ltui/.xmake/prefix/linux/x86_64/release_543d989b/lib } , version = 6.1 , includedirs = {

/home/markvoltz/ltui/.xmake/prefix/linux/x86_64/release_543d989b/include/ncurses , /home/markvoltz/ltui/.xmake/prefix/linux/x86_64/release_543d989b/include } } configure { luajit = true ccache = true clean = true plat = linux kind = static buildir = build mode = release arch = x86_64 host = linux }

---xmake output

configure { luajit = true ccache = true mode = release plat = linux kind = static buildir = build arch = x86_64 clean = true host = linux } [0mchecking for the gcc ... [38;5;2m/usr/bin/gcc [0m [0m [2mchecking for the c compiler (cc) ... [38;5;2mgcc [0m [0mchecking for the ccache ... [38;5;1mno [0m [0mchecking for the /usr/bin/gcc ... [38;5;2mok [0m [0m [2mchecking for the flags (-Wno-error=deprecated-declarations) ... [38;5;2mok [0m [0m [2m> gcc -Wno-error=deprecated-declarations -m64 -I/usr/local/include -I/usr/include [0m [0m [2mchecking for the flags (-fno-strict-aliasing) ... [38;5;2mok [0m [0m [2m> gcc -fno-strict-aliasing -m64 -I/usr/local/include -I/usr/include [0m [0m [2mchecking for the flags (-Wno-error=nullability-completeness) ... [38;5;1mno [0m [0m [2m> gcc -Wno-error=nullability-completeness -m64 -I/usr/local/include -I/usr/include [0m [0m [38;5;3mcheckinfo: [0;2m /home/markvoltz/.local/share/xmake/core/base/os.lua:705: cc1: error: -Werror=nullability-completeness: no option -Wnullability-completeness

stack traceback: [C]: in function 'error' [/home/markvoltz/.local/share/xmake/core/base/os.lua:705]: in function 'raise'

function 'runv'

[0m [2mchecking for the flags (-fomit-frame-pointer) ... [38;5;2mok [0m [0m [2m> gcc -fomit-frame-pointer -m64 -I/usr/local/include -I/usr/include [0m [0m [2mchecking for the flags (-Wno-expansion-to-defined) ... [38;5;2mok [0m [0m [2m> gcc -Wno-expansion-to-defined [0m [0mchecking for the g++ ... [38;5;2m/usr/bin/g++ [0m [0m [2mchecking for the shared library linker (sh) ... [38;5;2mg++ [0m

On Sun, Mar 17, 2019 at 10:10 PM ruki notifications@github.com wrote:

? I didn't see anything.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tboox/ltui/issues/5#issuecomment-473754179, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYzioRP_5Ni4ihhvdDz92cnrnwy_aXlks5vXwOTgaJpZM4b35WK .

--

waruqi commented 5 years ago

I still don't see the complete log error message. I don't know what problem you are currently experiencing. Is there strange text in running dialog.lua?

mvoltz commented 5 years ago

Replying via email is not working out. I have pasted directly into github. Sorry for the time wasted.

markvoltz@local:~/ltui$ xmake f --luajit=y -c -v -D checking for the architecture ... x86_64 checking for the unzip ... /usr/bin/unzip checking for the git ... /usr/bin/git checking for the gzip ... /bin/gzip checking for the tar ... /bin/tar checking for the ping ... /bin/ping pinging for the host(github.com) ... 37 ms pinging for the host(gitlab.com) ... 59 ms pinging for the host(gitee.com) ... 311 ms finding luajit from xmake .. checking for the xmake::luajit ... 2.0.5

{ links = { luajit } , linkdirs = { /home/markvoltz/.config/.xmake/prefix/linux/x86_64/release/lib } , version = 2.0.5 , includedirs = { /home/markvoltz/.config/.xmake/prefix/linux/x86_64/release/include/luajit } } finding ncurses from xmake .. checking for the xmake::ncurses ... 6.1

{ links = { ncurses , form , panel , menu } , linkdirs = { /home/markvoltz/ltui/.xmake/prefix/linux/x86_64/release_543d989b/lib } , version = 6.1 , includedirs = { /home/markvoltz/ltui/.xmake/prefix/linux/x86_64/release_543d989b/include/ncurses , /home/markvoltz/ltui/.xmake/prefix/linux/x86_64/release_543d989b/include } } configure { luajit = true ccache = true clean = true plat = linux kind = static buildir = build mode = release arch = x86_64 host = linux }


markvoltz@local:~/ltui$ xmake -v -D configure { luajit = true ccache = true mode = release plat = linux kind = static buildir = build arch = x86_64 clean = true host = linux } checking for the gcc ... /usr/bin/gcc checking for the c compiler (cc) ... gcc checking for the ccache ... no checking for the /usr/bin/gcc ... ok checking for the flags (-Wno-error=deprecated-declarations) ... ok

gcc -Wno-error=deprecated-declarations -m64 -I/usr/local/include -I/usr/include checking for the flags (-fno-strict-aliasing) ... ok gcc -fno-strict-aliasing -m64 -I/usr/local/include -I/usr/include checking for the flags (-Wno-error=nullability-completeness) ... no gcc -Wno-error=nullability-completeness -m64 -I/usr/local/include -I/usr/include checkinfo: /home/markvoltz/.local/share/xmake/core/base/os.lua:705: cc1: error: -Werror=nullability-completeness: no option -Wnullability-completeness

stack traceback: [C]: in function 'error' [/home/markvoltz/.local/share/xmake/core/base/os.lua:705]: in function 'raise' [...markvoltz/.local/share/xmake/core/sandbox/modules/os.lua:311]: in function 'runv' [...local/share/xmake/modules/detect/tools/gcc/has_flags.lua:48]: checking for the flags (-fomit-frame-pointer) ... ok

gcc -fomit-frame-pointer -m64 -I/usr/local/include -I/usr/include checking for the flags (-Wno-expansion-to-defined) ... ok gcc -Wno-expansion-to-defined checking for the g++ ... /usr/bin/g++ checking for the shared library linker (sh) ... g++

image

waruqi commented 5 years ago

There are some incompatibilities in drawing boundary characters on your system, and you may need to debug the following lua code.

https://github.com/tboox/ltui/blob/e84c9b2972f0b36c5e9ef03132e5d3b157aa77bb/src/ltui/border.lua#L66-L74

mvoltz commented 5 years ago

I will take a look. Thank you.

On Mon, Mar 18, 2019 at 7:54 PM ruki notifications@github.com wrote:

There are some incompatibilities in drawing boundary characters on your system, and you may need to debug the following lua code.

https://github.com/tboox/ltui/blob/e84c9b2972f0b36c5e9ef03132e5d3b157aa77bb/src/ltui/border.lua#L66-L74

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tboox/ltui/issues/5#issuecomment-474156467, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYzij0MaoavfBjJ2WhXTJer8VAk5AA7ks5vYDUpgaJpZM4b35WK .

--