[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [LuaSQL 2.2.0] ls_sqlite3.c: error: expected expression before / token
- From: Gilles Ganault <gilles.ganault@...>
- Date: Fri, 15 Apr 2011 20:15:36 +0200
On Fri, 15 Apr 2011 08:42:05 -0300, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>Do you have ldd or strace in your new host?
Neither strace nor ldd could compile for that environment, but scanelf
works OK to return the required shared libraries:
/var/tmp> ./scanelf -qn lua
libm.so.0,libdl.so.0,libgcc_s.so.1,libc.so.0 lua
/var/tmp> ./scanelf -qn sqlite3.so
libgcc_s.so.1,libc.so.0 sqlite3.so
So it doesn't look like I'm missing some shared libraries.
Is there a way to ask the Lua interpreter to be more explicit than
simply complaining with "Unable to resolve symbol"?
>BTW, I tried to follow your steps and I get this:
> ./sqlite3.so: undefined symbol: pthread_mutexattr_init
>
>Perhaps this is the same problem as yours, ie, you need -lpthread somewhere.
I thought about this, but according to the SQLite page, we can disable
the use of threads through the compile-time setting
-DSQLITE_THREADSAFE=0 which I use:
"The pthreads library is needed to make SQLite threadsafe. But since
the CLI is single threaded, we could instruct SQLite to build in a
non-threadsafe mode and thereby omit the pthreads library:
gcc -DSQLITE_THREADSAFE=0 shell.c sqlite3.c -ldl"
www.sqlite.org/howtocompile.html
>Since you're using the amalgamated version of sqlite3, I guess you
>should create a .so with the correct dependencies, not use a .o directly.
Mm... I don't know what that means :-/ I thought the single-file
amalgamated version would have more success of working.
So I also tried the auto-conf version, but I still get the "Unable to
resolve symbol".
Actually, I'm a bit in the dark about what LuaSQL expects:
- sqlite3.c compiled as sqlite3.o
- sqlite3.c compiled as sqlite.o, and turned into the static library
libsqlite3.a
- - sqlite3.c compiled as sqlite.o, and turned into the shared library
sqlite3.so
Thank you.