lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Shouldn't LUA_CPATH contain something like "/usr/local/lib/lua/5.4/posix/sys/?.so" instead of just "/usr/local/lib/lua/5.4/posix/sys/" ?

Le 30/10/2023 à 01:37, DENIS a écrit :
you must set lua path/cpath inside your script lua

>>>
package.path = os.getenv("LUA_PATH")
package.cpath = os.getenv("LUA_CPATH")
<<<

$ export LUA_CPATH=/opt/lua; lua-5.1 -e 'print(os.getenv("LUA_CPATH"))'
/opt/lua




---- Em Dom, 29 out 2023 15:08:46 -0300 konstantinos Dms <konstantinosdms@gmail.com> escreveu ---

My > print(package.path)
/usr/local/bin/lua;/usr/local/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?/init.lua;/usr/local/lib/lua/5.4/?.lua;/usr/local/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua
My > print(package.cpath)
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/

My echo $LUA_CPATH
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/
My echo $LUA_PATH
/usr/local/bin/lua;;

my v.code:
module 'posix.signal' not found:
no field package.preload['posix.signal']
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'
no file '/home/konstantinos/Desktop/server/lua-apps/posix.so'
no file '/home/konstantinos/Desktop/server/lua-apps/posix.so'
on local posix = require('posix.signal'), seraches on the path i have my deployment folder.

vscode launch.json file

"configurations": [
{
"type": "lua",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/lua.lua",
"cpath": "${env:LUA_CPATH}"
}
]


Any suggestion?