lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Simon

> I am building in a Visual Studio 2017 environment, in a command shell on Windows 10,  with paths etc, set up correctly, I believe.  I am building for lua5.3.  If I run the command “luarocks53 install lua-sqlite3” I get this error message:
>
> Error: Could not find header file for SQLITE
>   No file sqlite3.h in c:/external/include
> You may have to install SQLITE in your system and/or pass SQLITE_DIR or SQLITE_INCDIR to the luarocks command.
> Example: luarocks install luasql-sqlite3 SQLITE_DIR=/usr/local
>
> This suggests that I need to install SQLITE first.
Yes, you do.

>  However, if I run command “luarocks53 install sqlite” it says “Error: no results matching query were found”.  If I run the command “luarocks53 install sqlite3” I get the same error message that I got when I tried to install luasql-sqlite3.
LuaRocks cannot install SQLite.  You have to install it using another
tool since it is not related to Lua. The same aplies to other SGBDs
you may be interested in.

> I’ve tried looking on the SQLITE site but can’t work out what I need to download to get the build to work.  Can anyone tell me what I need to do to get the install to work for sqlite3 please?  And also for ODBC and MySql?  I get similar errors for them.
It seems you didn't understand what the drivers mean.  I'll try to
explain.  The SGBDs are tools made to work over your OS.  They usually
provide an optional interface to some languages to allow programs to
communicate to the SGBD, but Lua is not one of them.  Thus, the LuaSQL
drivers do this job.  They are written in C, using two interfaces,
Lua's C API and the database C API, and they establish these bridge
over the two systems: the SGBD and Lua.

That said, to compile and build any LuaSQL driver you have to install
Lua C API library (where you'll find lua.h etc.) and the SGBD C API
library (where you'll find sqlite3.h, for instance).  And tell
LuaRocks where these files could be found by using SQLITE_INCDIR.
When installing LuaRocks you already configured it to find Lua's
files.

Regards,
Tomás