Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/137.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为Lua绑定导入Nim模块时,错误显示:“0”;无法加载:lua(| 5.1 | 5.0).dll“;_Dll_Lua_Nim Lang - Fatal编程技术网

为Lua绑定导入Nim模块时,错误显示:“0”;无法加载:lua(| 5.1 | 5.0).dll“;

为Lua绑定导入Nim模块时,错误显示:“0”;无法加载:lua(| 5.1 | 5.0).dll“;,dll,lua,nim-lang,Dll,Lua,Nim Lang,我是Nim编程语言的新手,来自Lua背景,发现有一个模块可以向Nim添加Lua绑定,这让我很兴奋 我为Windows安装了Nimble(Nim的软件包管理器),并执行了“Nimble安装lua”来下载并安装正确的模块。在尝试导入并编译源代码时,发生了以下情况: C:\Users\Ashley\Desktop\Stuff\Coding\Nim\Projects\LuaTest>nim c -r "C:\Users\Ashley\Desktop\Stuff\Coding\Nim\Project

我是Nim编程语言的新手,来自Lua背景,发现有一个模块可以向Nim添加Lua绑定,这让我很兴奋

我为Windows安装了Nimble(Nim的软件包管理器),并执行了“Nimble安装lua”来下载并安装正确的模块。在尝试导入并编译源代码时,发生了以下情况:

C:\Users\Ashley\Desktop\Stuff\Coding\Nim\Projects\LuaTest>nim c -r "C:\Users\Ashley\Desktop\Stuff\Coding\Nim\Projects\LuaTest\main.nim"
Hint: system [Processing]
Hint: main [Processing]
Hint: lua [Processing]
CC: main
CC: lua_lua
Hint:  [Link]
Hint: operation successful (10698 lines compiled; 1.262 sec total; 16.163MB; Debug Build) [SuccessX]
could not load: lua(|5.1|5.0).dll
Error: execution of an external program failed: 'c:\users\ashley\desktop\stuff\coding\nim\projects\luatest\main.exe '

我已经安装了Lua5.1,路径中有正确的条目。它位于程序文件(x86)中。该目录包含一个名为lua5.1.dll的dll。我试着在谷歌上查找错误,但是没有结果。可能是什么问题?

在Windows上,您可以将库与生成的二进制文件放在同一位置。在这种情况下,该文件应称为
lua.dll
lua5.1.dll
lua5.0.dll
。还要确保库和二进制文件都适用于相同的系统体系结构,x86(32位)或x86-64(64位).

尝试将dll放在与项目相同的目录中:
C:\Users\Ashley\Desktop\Stuff\Coding\Nim\Projects\LuaTest
@hjpotter92发生了相同的问题,如果将其放在Nim所在的目录中installed@hjpotter92没有,我尝试了C:\Nim和C:\Nim\b这不起作用。不过,您可能了解了一些情况,因为我的Lua安装是32位的,Nim编译器是64位的。为了解决这个问题,我使用“-cpu:i386”标志进行了编译,但结果也出现了相同的错误。谢谢你的帮助!