0

I am trying to use the .NET CLR with Lua. In my .lua file on the first line, I have:

require "luanet"

I can load the dll, but immediately get an error:

error loading module 'luanet' from luanet.dll: luanet.dll:1: '=' expected near "

I have searched the Internet and I have downloaded and tried 3 different versions of this luanet.dll and I got the same error on all of them.

2 Answers 2

0

I solved this problem, although I am not sure it was the best solution. All I did was change the Build setting "Platform target" from "Any CPU" to "x86" and rebuild the luanet DLL and LuaInterface assembly. I also had to change that same build selection to "x86" in the C# application where I was using the LuaInterface assembly.

If someone know of a better or more eloquent solution, please pass it along.

Sign up to request clarification or add additional context in comments.

Comments

0

I almost forget - I also had to explicitly set the "package.path" in the Lua script to the place where the "luanet.dll" lives. Although the path in the LUA_PATH environmental variable had that correct path, for some reason I still had to set it in the Lua script before the line:

require 'luanet'

1 Comment

You should combine this and your other answer and accept it. You should also put the full details of what you set the paths to (something like package.path = DATA_DIR .. "\\lua\\?.lua;" .. package.path for example)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.