SQLite Lua 库
正在寻找一个好的 SQLite Lua 库。我找到了 LuaSQLite3 但试图弄清楚如何在 Lua 中使用它。我之前已经使用 RakNet(一个网络库)创建了 DLL 来向 Lua 公开函数,但不知道这个 SQLite 是如何工作的。这似乎是为非 Windows 机器编译的,我需要它用于 Windows。我可以创建 DLL,但不遵循它的工作原理。
附带的示例只是在文件顶部说了 require("lsqlite3") ,但我不知道该 Lua 文件在哪里。 C 代码将创建我期望 lsqlite3 加载的 DLL,因为我很确定 require()
不会加载 DLL,因为当我执行 RakNet DLL 时,我必须使用 < code>package.load() 我相信是的。所以lsqlite3一定是一个Lua文件,但是我在下载的包中没有看到它。也许我是瞎子:)
有什么想法吗?
我将 C 源文件拖入新的 Visual Studio Express 2010 DLL 项目中。引入Lua源码和sqlite源码并编译DLL。这一切顺利,所以我有一个 lsqlite3.dll 文件。当我将 require("lsqlite3")
放入我的 Lua 项目中时,我收到 Lua 的错误,说它无法打开该文件。该文件与我的 lua 解释器位于同一目录中。
Looking for a good SQLite Lua library. I found LuaSQLite3 but trying to figure out how to use it in Lua. I've created DLL's to expose functions to Lua before with RakNet (a networking library), but can't see how this SQLite would work. This seems to be setup to compile for non-Windows machines and I would need it for Windows. I can create a DLL but not following how it works.
The examples that come with it simply say require("lsqlite3") at the top of the files, but I don't know where that Lua file is. The C code would create the DLL that I would expect that lsqlite3 would load in because I'm pretty sure require()
doesn't load a DLL as when I did my RakNet DLL I had to use package.load()
I believe it was. So lsqlite3 must be a Lua file, but I don't see it in the downloaded package. Maybe I'm blind :)
Any ideas?
I pulled the C source file into a new Visual Studio Express 2010 DLL project. Brought in Lua source and sqlite source and compiled the DLL. That worked all well and so I have a lsqlite3.dll file. When I put require("lsqlite3")
in my Lua project I get an error from Lua saying it can't open the file. The file is in the same dir as my lua interpreter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将在这里找到一些有用的示例: http://barracudaserver.com/ba/doc /en/lua/luasql.html
玩得开心!
You will find some useful examples here: http://barracudaserver.com/ba/doc/en/lua/luasql.html
Have fun!