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 building with xmake: undeclared function #35

Open monguito opened 12 months ago

monguito commented 12 months ago

Describe the bug

While building with xmake, there's an error in curses.c . error: implicit declaration of function ‘luaL_setfuncs’. This might be because the function luaL_setfuncs is not properly declared

Expected behavior

No errors while builing

Error output

error: src/core/curses/curses.c:838:5: error: implicit declaration of function ‘luaL_setfuncs’; did you mean ‘lua_setfenv’? [-Werror=implicit-function-declaration]

Related Environment

Please provide the compilation or runtime environment information.

Additional context

Add any other context about the problem here.

waruqi commented 12 months ago

maybe you installed old lua on your system.

you can try use luajit xmake f --luajit=y or use remove lua version.

https://github.com/tboox/ltui/blob/285053d4f7b1b7ba90c16b98f1bf8bb9f837ace7/xmake.lua#L51

change add_requires("lua") -> add_requires("lua", {system = false})

or you can uninstall lua on your machine.