lua-users home
lua-l archive

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


I'm not familiar with doing this, but try this link:
https://raginginverno.wordpress.com/2013/01/23/welcome/ It explains
how to generate a .lib file from the .def file. Seems pretty
straightforward.

For the record, the issue here is that when you compile a DLL in
Visual Studio, VS generates both a .dll file and a .lib file. The
library actually resides in the .dll file, but in order to link a
program or another library to that DLL, you need to point it to the
.lib file, which contains the symbols and other information needed for
successful linkage.

On Wed, May 29, 2019 at 12:54 PM Simon Orde
<SimonOrde@family-historian.co.uk> wrote:
>
> Hi Tomas
>
> Thanks for the post.  I presume when you say "SGBD" you mean what I would call "DBMS"?  I know what a DBMS is.  You say "you have to install ... the SGBD C API library (where you'll find sqlite3.h, for instance). "  So you're saying that I have to install the SQLite C API library - right?  OK - well that's what I cannot do.
>
> I have downloaded just about every zip file I can find on the SQLite website.  Between them I can put together a folder that contains sqlite3.h, sqlite3.dll, and sqlite3.def (I got the sqlite3.h from the source code zip).  But when I try to build against this folder using luarocks (with SQLITE_DIR pointing to this folder) I get a link error because it cannot find 'sqlite3.lib'.  And neither can I.  I haven't found a sqlite3.lib file anywhere.
>
> According to this StackOverflow page - https://stackoverflow.com/questions/23718146/creating-an-sqlite3-lib-file-using-sqlite3-in-visual-studios - "The suggested way of using the SQLite library is to embed it directly in your application, i.e., download the amalgamation source code, and just add the sqlite3.c and .h files to your project in the sample place where you have the other source files."  Except that I can't do that because I'm not trying to embed the SQLite library into my application.  I'm trying to build a luasql dll that has SQLite embedded in it.
>
> Any suggestions about where I can find the files I need (e.g. sqlite3.lib and the version of sqlite3.h and sqlite3.dll that go with it) to build the luasql sqlite3 dll?
>
> Failing that, does anyone already have the binaries I need?  i.e. ones that are compatible with Visual Studio 2017?
>
> All help much appreciated.
>
> Simon
>
>
> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On Behalf Of Tomás Guisasola
> Sent: 29 May 2019 2:29 PM
> To: Lua mailing list
> Subject: Re: Advice on building luasql please
>
> 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
>
>