lua-users home
lua-l archive

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


17.09.2023 05:59, Paul K пишет:
Hi Alex,

I can't think of anything that ZeroBrane Studio does that would
prevent your script from running; It may add a couple of folders to
reference the libraries that are packaged with it, but as long as the
correct interpreter is selected, it should run all the scripts in
exactly the same way as they can be run outside of ZBS.

Let's say you run your script from folder X using a lua interpreter of
version 5.3 and everything works; you can try the following:
- open the IDE and select folder X as the project folder
- select 5.3 as the current Lua interpreter (Project > Lua Interpreter
Lua 5.3)
- execute the script from the IDE.

It is possible that you are on Windows and use a 64bit Lua interpreter
(with your libraries compiled for it), but the one that is included
with ZBS is 32bit, so it doesn't load those libraries. You can
configure the IDE to use your external interpreter along with its
libraries instead of the default one (see this page for details:
https://studio.zerobrane.com/doc-remote-debugging#debugging-of-64bit-applications).

If you still have the issue, then you need to post the exact error
message from 'require" along with the details of where the library is
located and the OS you're using.

Paul.

Thank you for your answer. I tried adding

path.lua = '/usr/bin/lua'
path.lua52 = '/usr/bin/lua5.2'
path.lua53 = '/usr/bin/lua5.3'
path.lua54 = '/usr/bin/lua5.4'
path.luajit = '/usr/bin/luajit'

to /opt/zbstudio/cfg/user.lua, but it did not help.

Finally, this helped:
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.1-rex-pcre2.so.0.0.0 /usr/local/lib/lua/5.1/rex_pcre2.so sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.2-rex-pcre2.so.0.0.0 /usr/local/lib/lua/5.2/rex_pcre2.so sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.3-rex-pcre2.so.0.0.0 /usr/local/lib/lua/5.3/rex_pcre2.so

Alexander Mashin