Sorry for my english.
I try to add a new SQL function (sqrt) as described at
http://www.hwaci.com/sw/sqlite/c_interface.html#cfunc
If I try (for understanding pourpose only) to return the same value I give to
the function it's all ok, then (for a little experiment) I try to return the
abs and it's ok again, but when I try to return the sqrt I obtain a compile
error:
./libtool --mode=link gcc -g -O2 -DTHREADSAFE=1 -DOS_UNIX=1 -DOS_WIN=0
-DHAVE_USLEEP=1 -I. -I../sqlite/src -DHAVE_READLINE=0 -o
sqlite ../sqlite/src/shell.c \
libsqlite.la
gcc -g -O2 -DTHREADSAFE=1 -DOS_UNIX=1 -DOS_WIN=0 -DHAVE_USLEEP=1 -I.
-I../sqlite/src -DHAVE_READLINE=0
-o .libs/sqlite ../sqlite/src/shell.c ./.libs/libsqlite.so
./.libs/libsqlite.so: undefined reference to `sqrt'
collect2: ld returned 1 exit status
make: *** [sqlite] Error 1
I have add this :
/*
** Implementation of sqrt by Edo
*/
static void sqrtFunc(sqlite_func *context, int argc, const char **argv){
assert( argc==1 );
sqlite_set_result_double(context,sqrt(sqliteAtoF(argv[0],0)));
}
and ...
} aFuncs[] = {
{ "sqrt", 1, SQLITE_NUMERIC, 0, sqrtFunc }, // ... this row
{ "min", -1, SQLITE_ARGS, 0, minmaxFunc },
Someone can help me ? (sorry again for my english).
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Da 1.500 a 10.000 Euro per realizzare i tuoi desideri con sicurezza e semplicit�,
clicca e richiedi il tuo prestito
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1964&d=18-8