Closed gnarz closed 5 years ago
I read code https://github.com/keplerproject/luasql/blob/ac557a7fcdea0f5e887d1329f96f79d66bc9ed10/src/ls_mysql.c#L494. luaL_optint has been replaced with luaL_optinteger for lua5.3.
But when I use luasql-mysql .then
sudo luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql
and write a test. some error occur :
lua: error loading module 'luasql.mysql' from file '/usr/local/lib/lua/5.3/luasql/mysql.so':
/usr/local/lib/lua/5.3/luasql/mysql.so: undefined symbol: luaL_optint
stack traceback:
[C]: in ?
[C]: in function 'require'
test_mysql_lua.lua:1: in main chunk
[C]: in ?
Is that because luarocks mysql.so file is old file (lua5.2)?
I'm guessing (not a rocks user) that it's pulling the old 2.3.0 branch, you'll need to use the cvs-1 version to get the current stuff.
Remove what you've just installed and, I think...
sudo luarocks install luasql-mysql cvs-1 MYSQL_INCDIR=/usr/include/mysql
...or something like that.
Thank you very much!
But, I
sudo luarocks install luasql-mysql cvs-1 MYSQL_INCDIR=/usr/include/mysql
then
Warning: falling back to wget - install luasec to get native HTTPS support
Error: No results matching query were found.
No matching!!!
You need to specify a different rock repository to get the cvs-1
release. Try using the dev
repo at http://rocks.luarocks.org/dev
.
sudo luarocks --from=http://rocks.luarocks.org/dev install luasql-mysql cvs-1 MYSQL_INCDIR=/usr/include/mysql
Thank you very much! That`s OK!
thanks guys, that is very useful for lua 5.3 version .
Get it, that is very good message! Thank you very much!
Very good
Helpful!
me too ! /usr/local/bin/lua: error loading module 'luasql.mysql' from file '/usr/local/lib/lua/5.3/luasql/mysql.so': dlopen(/usr/local/lib/lua/5.3/luasql/mysql.so, 6): Symbol not found: _luaL_optint Referenced from: /usr/local/lib/lua/5.3/luasql/mysql.so Expected in: flat namespace in /usr/local/lib/lua/5.3/luasql/mysql.so stack traceback: but now!
sudo luarocks --from=http://rocks.luarocks.org/dev install luasql-mysql cvs-1 MYSQL_INCDIR=/usr/include/mysql
it is ok!
@tomasguisasola Perhaps it's time to package the current Git as LuaSQL-MySQL 2.3.1? Looks like lots of people are looking for Lua 5.3 support.
Yes please... It's the only thing left for sailor 5.3 support and only a new rockspec upload of this is missing! :) @tomasguisasola
@rjpcomputing
sudo luarocks --from=https://luarocks.org/dev install luasql-mysql cvs-1 MYSQL_DIR=/usr/local/mysql
In the win system, lua5.3 uses mysql.dll. "Error: error loading module'luasql_mysql'from file"'.mysql.dll is obtained through luasql-master. Strangely, another generated DLL can be invoked by lua5.3.
with a tiny change, luasql-mysql is ready for lua 5.3. In src/ls_mysql.c line 494 replace luaL_optint with luaL_optinteger.