On Thu, Jun 12, 2008 at 04:26:13PM +0400, Alexey Pechnikov scratched on the wall: > В сообщении от Friday 06 June 2008 03:51:38 P Kishor написал(а): > > http://sqlite.org/contrib/download/extension-functions.c?get=22 > > $ wget http://sqlite.org/contrib/download/extension-functions.c?get=22 > $ mv extension-functions.c?get=22 extension-functions.c > $ gcc -fPIC -shared extension-functions.c -o libsqlitefunctions.so > $ sqlite3 :memory: > SQLite version 3.5.9 > Enter ".help" for instructions > sqlite> SELECT load_extension('./libsqlitefunctions.so'); > SQL error: ./libsqlitefunctions.so: undefined symbol: log > > What can I do?
The extension-functions file doesn't actually implement any of the math functinos, it simply acts as a glue layer between SQLite and the system math library. In this case, it looks like the run-time linker that loads the extension can't resolve the call for log() from the extension into the math library, resulting in an unresolved link. On many systems the math library is part of the standard set of libs that are imported by the linker for all applications. There are a few systems, however, where the math library is not part of the standard lib set. On those systems, you need to explicitly tell the linker you want the math library made avaliable. You can do that by compiling the lib with -lm to import the math library. The math lib won't be pulled into the .so, but it will be noted that if the run-time linker pulls in the extension, it will also need to pull in the math library before it attepts to resolve all the symbols. At least, in theory. What OS are you trying this on? -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006" _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users