lua-users home
lua-l archive

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


On 6 January 2014 14:11, Gilles Ganault <gilles.ganault@free.fr> wrote:
> On Mon, 06 Jan 2014 16:56:00 +0100, Gilles Ganault
> <gilles.ganault@free.fr> wrote:
>>gcc -O2 -fPIC -I/usr/include/lua5.1 -c lsqlite3.c -o lsqlite3.o
>>-I/tmp/sqlite3/sqlite-amalgamation-3080200
>>gcc -shared -o lsqlite3.so -L/usr/local/lib lsqlite3.o
>>-L/usr/local/lib -lsqlite3
>>/usr/bin/ld: cannot find -lsqlite3
>>collect2: ld returned 1 exit status
>>cp: cannot stat `lsqlite3.so': No such file or directory
>>
>>Error: Build error: Failed installing lsqlite3.so in
>>/usr/local/lib/luarocks/rocks/lsqlite3/0.9.1-2/lib
>
> That part is solved: For some reason, I had to rerun "apt-get update"
> for apt-get to locate the package:
> ===========================
> # apt-get install libsqlite3-dev
>
> # luarocks install lsqlite3
> SQLITE_INCDIR=/tmp/sqlite3/sqlite-amalgamation-3080200

Now that you installed libsqlite3-dev you should have sqlite3.h
installed in your system, and not need to use /tmp/sqlite3 (and anyway
you shouldn't because you should use the header file that matches your
system installation).

Basically, you need to figure out where in your system the files
sqlite3.h and libsqlite3.so are (the "locate" and/or "find" commands
may help you there).

Once you found them, say $INCDIR is where you found sqlite3.h and
$LIBDIR is where you found libsqlite3.so. Then do

   luarocks install lsqlite3 SQLITE_INCDIR=$INCDIR SQLITE_LIBDIR=$LIBDIR

(for example, it may be something like this

   luarocks install lsqlite3 SQLITE_INCDIR=/usr/include
SQLITE_LIBDIR=/usr/lib/x86_64-linux-gnu

)

> # luarocks list
>
> Installed rocks:
> ----------------
>
> lsqlite3
>    0.9.1-2 (installed) - /usr/local/lib/luarocks/rocks

Since your compilation failed, LuaRocks shouldn't have installed that
package. Are you using an outdated version? The latest is 2.1.1.

   luarocks --version

Try installing the lsqlite3 rock again with the variables mentioned
above and things should work.

Hope that helps!

-- Hisham