Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luarocks install luasql-odbc Error !! #118

Open
yabb-cyber opened this issue Oct 30, 2019 · 3 comments
Open

luarocks install luasql-odbc Error !! #118

yabb-cyber opened this issue Oct 30, 2019 · 3 comments

Comments

@yabb-cyber
Copy link

Luarocks install luasql-odbc error compile.
gcc -O2 -fPIC -I/usr/include/lua5.2 -c src/luasql.c -o src/luasql.o -I/usr/include
gcc -O2 -fPIC -I/usr/include/lua5.2 -c src/ls_odbc.c -o src/ls_odbc.o -I/usr/include
src/ls_odbc.c:39:2: error: unknown type name ‘SQLHENV’
SQLHENV henv; /* environment handle /
^~~~~~~
src/ls_odbc.c:47:2: error: unknown type name ‘SQLHDBC’
SQLHDBC hdbc; /
database connection handle /
^~~~~~~
src/ls_odbc.c:56:2: error: unknown type name ‘SQLHSTMT’
SQLHSTMT hstmt; /
statement handle */
^~~~~~~~
src/ls_odbc.c:117:38: error: unknown type name ‘SQLSMALLINT’
static int fail(lua_State *L, const SQLSMALLINT type, const SQLHANDLE handle) {
^~~~~~~~~~~
src/ls_odbc.c:117:62: error: unknown type name ‘SQLHANDLE’
static int fail(lua_State *L, const SQLSMALLINT type, const SQLHANDLE handle) {
^~~~~~~~~
src/ls_odbc.c: In function ‘fail’:

@tyree731
Copy link

tyree731 commented Nov 7, 2019

Looks like a patch could be as simple as:

diff --git a/rockspec/luasql-odbc-cvs-1.rockspec b/rockspec/luasql-odbc-cvs-1.rockspec
index 99a45fe..37e599d 100644
--- a/rockspec/luasql-odbc-cvs-1.rockspec
+++ b/rockspec/luasql-odbc-cvs-1.rockspec
@@ -23,8 +23,8 @@ external_dependencies = {
 }
 build = {
    type = "make",
+   build_target = "odbc",
    variables = {
-      T="odbc",
       LIB_OPTION = "$(LIBFLAG) -L$(ODBC_LIBDIR) -lodbc",
       CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR) -I$(ODBC_INCDIR) -DUNIXODBC"
    },

Does this seem reasonable?

@tomasguisasola
Copy link
Contributor

It seems the ODBC driver is outdated. I checked with both unixodbc and libiodbc2-dev Ubuntu packages and they provide different sql.h files, any of these are compatible with LuaSQL ODBC driver...

@tyree731
Copy link

In our case we're using RHEL7, which presumably has fairly old odbc drivers, so I wouldn't be surprised. That said, if the proposed patch makes lua-odbc work with old and new versions of odbc libraries, isn't that a good thing to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants