On Thu, May 23, 2013 at 7:33 AM, Prashant Shah <pshah.mum...@gmail.com>wrote:

> libsqlite4.a(fts5func.o): In function `fts5Rank':
> /home/user/db/build/sqlite4/src/fts5func.c:159: undefined reference to
> `log'
> collect2: ld returned 1 exit status
> make: *** [sqlite4] Error 1
>

The problem is that fts5func.c uses log() from math.h, which requires
linking against -lm. A quick workaround is to copy/paste the output from
where the build fails and add -lm to it:

stephan@tiny:~/cvs/fossil/sqlite4$ gcc -g -fPIC -UNDEBUG -DDEBUG -Wall
-std=c89  -I. -I./src -I.  -I./ext/rtree -I./ext/icu -I./ext/fts3
-I./ext/async  -o sqlite4 ./src/shell.c libsqlite4.a -lm
./src/shell.c: In function 'do_meta_command':
./src/shell.c:1888:7: warning: implicit declaration of function 'pclose'
[-Wimplicit-function-declaration]
./src/shell.c:1894:7: warning: implicit declaration of function 'popen'
[-Wimplicit-function-declaration]
./src/shell.c:1894:14: warning: assignment makes pointer from integer
without a cast [enabled by default]
stephan@tiny:~/cvs/fossil/sqlite4$ ldd sqlite4
linux-gate.so.1 =>  (0xb77bd000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7775000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb75cb000)
/lib/ld-linux.so.2 (0xb77be000)

i'll try to figure out where that fix belongs. fts5func.c says, though:

#include <math.h>                 /* temporary: For log() */

so i suspect that -lm is not intended to be needed long-term.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to