I'm trying to install the ODBC driver (?) for Lua. I'm running Windows 10 and have followed the instructions at http://www.thijsschreijer.nl/blog/?p=863 as far as the command "lua -l socket"
Here is a screen copy of my command and the results
C:\Program Files (x86)\LuaRocks>luarocks install luasql-odbc
Installing https://luarocks.org/luasql-odbc-2.4.0-1.src.rockC:\MinGW\bin\gcc.exe -O2 -c -o src/luasql.o -IC:\Program Files (x86)\Lua\5_3\include src/luasql.c -Ic:/mingw/include
C:\MinGW\bin\gcc.exe -O2 -c -o src/ls_odbc.o -IC:\Program Files (x86)\Lua\5_3\include src/ls_odbc.c -Ic:/mingw/include
C:\MinGW\bin\gcc.exe -shared -o luasql/odbc.dll src/luasql.o src/ls_odbc.o -Lc:/mingw -lodbc C:\Program Files (x86)\Lua\5_3\bin/lua53.dll -lm
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lodbc collect2.exe: error: ld returned 1 exit statusError: Build error: Failed compiling module luasql/odbc.dll
Since I'm a newbie to the whole concept of C programs etc, it might well be that I'm missing something that the experts would say "Well, OBVIOUSLY he's done this, that or the other". Don't bet on it!!
I downloaded luasql-master.zip but I'm not sure if I need to unzip/copy it to a specific luarocks (?) library.
I should point out that I can access a DB2 Express database on the same computer using Reginald Rexx and ODBC, so the ODBC availability shouldn't (?) be an issue, but maybe I DO need to copy some file to somewhere or other.
Any suggestions much appreciated (and I've googled until my eyes bleed, but all the questions people have appended seem to do with problems accessing any database AFTER they'd installed the relevant LuaSQL driver).
Added after more experimentation I tried running the install using the --verbose option. These are the relevant (?) results (I have the complete output saved on my desktop)
os.execute: C: & cd "C:\Users\Michael\AppData\Local\Temp\luarocks_luasql-odbc-2.4.0-1-209\luasql" & "C:\Program Files (x86)\LuaRocks/tools/mkdir.exe" -p "luasql" Results: 3 1 (boolean): true 2 (string): exit 3 (number): 0 C:\MinGW\bin\gcc.exe -shared -o luasql/odbc.dll src/luasql.o src/ls_odbc.o -Lc:/mingw -lodbc c:\program files (x86)\lua\5_3\bin/lua53.dll -lm
os.execute: C: & cd "C:\Users\Michael\AppData\Local\Temp\luarocks_luasql-odbc-2.4.0-1-209\luasql" & C:\MinGW\bin\gcc.exe -shared "-o" "luasql/odbc.dll" "src/luasql.o" "src/ls_odbc.o" "-Lc:/mingw" "-lodbc" "c:\program files (x86)\lua\5_3\bin\lua53.dll" "-lm" c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lodbc collect2.exe: error: ld returned 1 exit status Results: 3 1 (nil): nil 2 (string): exit 3 (number): 1
Error: Build error: Failed compiling module luasql/odbc.dll
While I assume Val is much more qualified that I am, I can't help thinking he (?) is off track with his comment about odbc.dll being missing. My impression is that odbc.dll will be created as a result of the install (or am I wrong?). My feeling is that something is missing in MinGw possibly ???
LUA_***_5_2must beLUA_***_5_3,luasql-master.zipis source code from GitHub (or seems so) and you don't need it (luarocks do that for you). As for your main error, compiler/linker can't find libraryodbc(odbc.dllI guess). Try to find out why by yourself (there are a lot of questions about it on SO). - val is still with Monicaodbc.dll. You should find out why. - val is still with Monica