我需要在Lua中加载DLL文件以连接不同的API。我知道可以加载C类型的dll,但是我拥有的是用C ++生成的dll文件。
生成该库的代码(在C ++中)具有以下形式:
// MyAPI.h
namespace MyAPI
{
public class MyFirstClass
{
public:
MyFirstClass();
void performSomeMethod(int arg);
}
}
然后生成dll文件MyAPI.dll
。现在,当我尝试使用Lua将其导入时:
require "MyAPI"
它立即给出错误:error loading module 'MyAPI' from file '.\MyAPI.dll': The specified procedure could not be found
。我不明白这是什么意思,或者如何摆脱它。Lua可以通常不包括C ++库吗(即,我应该编写另一个C包装器吗?),或者有办法做到这一点吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句