NLua / NLua

Bridge between Lua and the .NET.
http://nlua.org
MIT License
2.05k stars 309 forks source link

How to compile and use for Ubuntu 22.04 #527

Open TheVons opened 8 months ago

TheVons commented 8 months ago

I know issues isn't for help requests but there's no other option to submit in this project.

I am trying to call .net functions from lua scripts that are running in Ubuntu. Is there a guide on how to do this anywhere?

TheVons commented 8 months ago

I am able to compile .net 8 nlua on Ubuntu. My problem is figuring out how to actually use it...

~/tmp/luanet-test/NLua/build/net8.0/obj/Debug/net8.0$ ls
NLua.dll                                               NLua.net8.0.assets.cache                    NLua.net8.0.csproj.CoreCompileInputs.cache  NLua.net8.0.sourcelink.json  hello1.lua  refint
NLua.net8.0.GeneratedMSBuildEditorConfig.editorconfig  NLua.net8.0.csproj.AssemblyReference.cache  NLua.net8.0.csproj.FileListAbsolute.txt     NLua.pdb                     ref
user@stack:~/tmp/luanet-test/NLua/build/net8.0/obj/Debug/net8.0$ lua hello1.lua
lua: hello1.lua:1: module 'luanet' not found:
        no field package.preload['luanet']
        no file './luanet.lua'
        no file '/usr/local/share/lua/5.1/luanet.lua'
        no file '/usr/local/share/lua/5.1/luanet/init.lua'
        no file '/usr/local/lib/lua/5.1/luanet.lua'
        no file '/usr/local/lib/lua/5.1/luanet/init.lua'
        no file '/usr/share/lua/5.1/luanet.lua'
        no file '/usr/share/lua/5.1/luanet/init.lua'
        no file './luanet.so'
        no file '/usr/local/lib/lua/5.1/luanet.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/luanet.so'
        no file '/usr/lib/lua/5.1/luanet.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        hello1.lua:1: in main chunk
        [C]: ?
SimonCahill commented 2 months ago

Have you tried just including the package from NuGet?