如何在 C++ 中链接 LuaSQL应用?
当我从应用程序外部(终端)执行我的脚本时,它运行良好,但是当从 C++ 应用程序内部调用它时,它会在 require("luasql.mysql") 调用中关闭。
有人可以帮忙吗?
My script runs fine when I execute it from outside the application (terminal), but when its called from inside the C++ application it shuts down in the require("luasql.mysql") call.
Can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
必须在脚本内设置 package.cpath 和 package.path 才能加载已安装的模块。所以 package.cpath 必须有 lua 可以检查 clib 来加载它们的文件夹,package.path 也是如此,但这次是加载 lua 模块或文件。
The package.cpath and package.path must be set inside the script to load the modules that are installed. So package.cpath must have the folders that lua can check for the clibs to load them, and the same for package.path, but this time to load lua modules or files.