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

Issue installation mac os 10.14 #131

Closed
lodumont opened this issue Oct 12, 2021 · 5 comments
Closed

Issue installation mac os 10.14 #131

lodumont opened this issue Oct 12, 2021 · 5 comments

Comments

@lodumont
Copy link

lodumont commented Oct 12, 2021

I'm facing an issue installing luasql-odbc on mac os 10.14. I have lua 5.4 and luarocks, both installed with homebrew.

When I try : luarocks install luasql-odbc I get:

Installing https://luarocks.org/luasql-odbc-2.6.0-1.rockspec
Cloning into 'luasql'...
remote: Enumerating objects: 149, done.
remote: Counting objects: 100% (149/149), done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 149 (delta 72), reused 72 (delta 36), pack-reused 0
Receiving objects: 100% (149/149), 104.13 KiB | 6.94 MiB/s, done.
Resolving deltas: 100% (72/72), done.
Note: checking out '22d4a911f35cf851af9db71124e3998d96fb3fa1'.

luasql-odbc 2.6.0-1 depends on lua >= 5.1 (5.4-1 provided by VM)
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/luasql.c -o src/luasql.o -I/usr/local/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/ls_odbc.c -o src/ls_odbc.o -I/usr/local/include
src/ls_odbc.c:37:2: error: unknown type name 'SQLPOINTER'
        SQLPOINTER buf;
        ^
src/ls_odbc.c:38:2: error: unknown type name 'SQLINTEGER'
        SQLINTEGER len;
        ^
src/ls_odbc.c:39:2: error: unknown type name 'SQLINTEGER'
        SQLINTEGER type;
        ^
src/ls_odbc.c:51:2: error: unknown type name 'SQLHENV'
        SQLHENV       henv;               /* environment handle */
        ^
src/ls_odbc.c:58:2: error: unknown type name 'SQLHDBC'
        SQLHDBC       hdbc;               /* database connection handle */
        ^
src/ls_odbc.c:66:2: error: unknown type name 'SQLHSTMT'
        SQLHSTMT      hstmt;              /* statement handle */
        ^
src/ls_odbc.c:67:2: error: unknown type name 'SQLSMALLINT'
        SQLSMALLINT   numparams;          /* number of input parameters */
        ^
src/ls_odbc.c:85:18: error: unknown type name 'SQLRETURN'
static int error(SQLRETURN a)
                 ^
src/ls_odbc.c:87:15: error: use of undeclared identifier 'SQL_SUCCESS'
        return (a != SQL_SUCCESS) && (a != SQL_SUCCESS_WITH_INFO) && (a ...
                     ^
src/ls_odbc.c:87:37: error: use of undeclared identifier 'SQL_SUCCESS_WITH_INFO'
        return (a != SQL_SUCCESS) && (a != SQL_SUCCESS_WITH_INFO) && (a ...
                                           ^
src/ls_odbc.c:87:69: error: use of undeclared identifier 'SQL_NO_DATA'
  ...(a != SQL_SUCCESS) && (a != SQL_SUCCESS_WITH_INFO) && (a != SQL_NO_DATA);
                                                                 ^
src/ls_odbc.c:195:38: error: unknown type name 'SQLSMALLINT'
static int fail(lua_State *L,  const SQLSMALLINT type, const SQLHANDLE handle) {
                                     ^
src/ls_odbc.c:195:62: error: unknown type name 'SQLHANDLE'
static int fail(lua_State *L,  const SQLSMALLINT type, const SQLHANDLE handle) {
                                                             ^
src/ls_odbc.c:196:5: error: use of undeclared identifier 'SQLCHAR'
    SQLCHAR State[6];
    ^
src/ls_odbc.c:197:5: error: use of undeclared identifier 'SQLINTEGER'
    SQLINTEGER NativeError;
    ^
src/ls_odbc.c:198:5: error: use of undeclared identifier 'SQLSMALLINT'
    SQLSMALLINT MsgSize, i;
    ^
src/ls_odbc.c:199:5: error: use of undeclared identifier 'SQLRETURN'
    SQLRETURN ret;
    ^
src/ls_odbc.c:200:5: error: use of undeclared identifier 'SQLCHAR'
    SQLCHAR Msg[SQL_MAX_MESSAGE_LENGTH];
    ^
src/ls_odbc.c:205:5: error: use of undeclared identifier 'i'
    i = 1;
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Error: Build error: Failed compiling object src/ls_odbc.o

Any idea how I could make this work? Thank you!

@tomasguisasola
Copy link
Contributor

tomasguisasola commented Oct 12, 2021 via email

@laigor
Copy link
Contributor

laigor commented Oct 12, 2021

Try #129 (comment)

@tomasguisasola
Copy link
Contributor

Hi laigor

Adding CFLAGS="-DUNIXODBC" to LuaRocks command line solves the problem?

If it does, should we close those issues here on GitHub?

Regards,
Tomás

@lodumont
Copy link
Author

Thanks a lot for your advice, I solved my issue by adding CFLAGS="-DUNIXODBC" to the luarocks command. Unixodbc was installed but apparently not automatically detected.

@laigor
Copy link
Contributor

laigor commented Oct 13, 2021

I think it's too early to close this task. UNXIODBC should be detected automatically for linux and mac. Otherwise, it turns out that everyone, when installing luasql-odbc on linux or mac, will have to figure out why not to install ... At least it is necessary to write in the documentation how to do this so that there are no compilation errors.

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