Forgive me using this month old topic, but I don't think it'd be any good to start new one since what I'm about to ask strictly relates to the stuff written here (and plus I don't think much attention would be needed for SQL using LOVE, for reasons already mentioned in this thread).
So I'd like to use LOVE with access to mysql database. From all I've read here I concluded that the easiest would be to use LuaSQL.
I must admit I'm pretty green when it comes to lua, includes, libs etc. and all I needed so far was LOVE and LUBE.
I'm just working on little proof of concept and I just hope to mash up something real quick, so far LOVE was an absolute charm. I don't need it cross-platform, I just hope to have it running on my Win7 machine.
So, I've downloaded this package:
http://luaforge.net/frs/download.php/26 ... -lua51.zip
That contains 2 dlls. I tried to put them in LOVE and in my project folder (where main.lua is), preserving the /luasql/ folder and structure. From there I tried to include that lib in every way I could find to no avail. The closest I got is probably
But it throws error as if it couldn't find the file:
Code: Select all
Error: error loading module 'luasql.mysql' from file '.\luasql\mysql.dll':
The specified module could not be found.
stack traceback:
[C]: ?
[C]: in function 'require'
[string "main.lua"]:22: in main chunk
[C]: in function 'require'
[string "boot.lua"]:1: in function <[string "boot.lua"]:1>
[C]: in function 'xpcall'
When I placed empty file mysql.lua in /luasql/ folder it managed to load it just fine and carried on executing the rest of the code, so I figure it's not a matter of path.
I also tried
Code: Select all
package.loadlib('luasql.mysql', 'init')
it throws no error, but I can't seem to use anything from the lib (everything is a nil) and I have high doubt I provided correct 2nd argument anyway.
On LuaSQL, on the examples page I found the example use for Mysql driver at the very bottom:
http://www.keplerproject.org/luasql/examples.html
Seems like the solution I included here, but alas, the error I'm getting.
I'm using LOVE version 0.7.2 and checking with _VERSION I get Lua 5.1, so all should be good when it comes to version compatibility.
Please, help me and point out that [most likely very stupid] mistake I'm doing here.
EDIT:
I believe I've found a solution. After playing a bit with cpath, I managed to get an error that lua5.1dll was missing when I tried to include the lib with
So I installed lua5.1 for win and copied the lua5.1.dll to my app folder. After doing so, there were no errors starting up the application and i can successfully execute code
which leads me to believe I actually have the lib running in my app.
Leaving this info here, perhaps someone will find it useful.