0

我正在尝试将 .NET CLR 与 Lua 一起使用。在第一行的 .lua 文件中,我有:

需要“luanet”

我可以加载 dll,但立即得到一个错误:

从 luanet.dll 加载模块 'luanet' 时出错:luanet.dll:1: '=' 预期在“附近”

我搜索了互联网,下载并尝试了这个 luanet.dll 的 3 个不同版本,但我都得到了相同的错误。

4

2 回答 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.

于 2013-02-01T19:38:31.313 回答
0

我几乎忘记了——我还必须明确地将 Lua 脚本中的“package.path”设置为“luanet.dll”所在的位置。尽管 LUA_PATH 环境变量中的路径具有正确的路径,但由于某种原因,我仍然必须在 Lua 脚本中在该行之前设置它:

需要'luanet'

于 2013-02-01T19:45:52.280 回答