tboox / ltui

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

error loading module 'ltui.lcurses' from file '/usr/local/lib/lua/5.1/ltui.so' #7

Closed 4mig4 closed 4 years ago

4mig4 commented 4 years ago

Describe the bug

Tried you README.md example code:

luajit ./tests/dialog.lua

Error output

luajit: error loading module 'ltui.lcurses' from file '/usr/local/lib/lua/5.1/ltui.so':
    /usr/local/lib/lua/5.1/ltui.so: undefined symbol: acs_map
stack traceback:
    [C]: at 0x555821e25fe0
    [C]: in function 'require'
    /usr/local/share/lua/5.1/ltui/curses.lua:31: in main chunk
    [C]: in function 'require'
    /usr/local/share/lua/5.1/ltui/application.lua:30: in main chunk
    [C]: in function 'require'
    /usr/local/share/lua/5.1/ltui.lua:31: in main chunk
    [C]: in function 'require'
    ./tests/dialog.lua:27: in main chunk
    [C]: at 0x555821dd01d0

Related Environment

Installing https://luarocks.org/ltui-1.5-1.src.rock

gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/core/lcurses/lcurses.c -o src/core/lcurses/lcurses.o
gcc -shared -o ltui.so src/core/lcurses/lcurses.o
ltui 1.5-1 is now installed in /usr/local (license: Apache-2.0)
waruqi commented 4 years ago

you can try using xmake to build and run it.

xmake xmake run test dialog

waruqi commented 4 years ago

undefined symbol: acs_map gcc -shared -o ltui.so src/core/lcurses/lcurses.o

maybe do not link libncurse or libcurse

4mig4 commented 4 years ago

You need to fix the rockspec and reupload it once fixed.

https://luarocks.org/modules/waruqi/ltui <----

If your ltui requires xmake then you need to make this a dependency requirement in your ltui rockspec

waruqi commented 4 years ago

you can see https://xmake.io/#/guide/installation

only run the following command to install xmake.

bash <(wget https://xmake.io/shget.text -O -)
waruqi commented 4 years ago

I have fixed it, you can try reinstall it again via luarocks.

4mig4 commented 4 years ago

OK it is working now! thanks for fixing it