On Sun, Aug 25, 2013 at 6:25 AM, Mirat Bayrak <miratcanbay...@gmail.com>wrote:

> I needed wanted to build "did you mean this?" feature to my website. I'm
> using sqlite3 and learned that i can use spellfix module to order tables
> via levenstein.
>
> I downloaded source code of
> sqlite3<http://www.sqlite.org/2013/sqlite-src-3071700.zip> and
> compiled spellfix.c (it's inside /ext/misc/) like this:
>
> gcc -shared -fPIC -Wall -I/tmp/sqlite-src-3071700/ spellfix.c -o spellfix
>
> It compiles successfuly but when i load it into sqlite:
>
> sqlite> .load ./spellfix
>
> I'm getting this error:
>
> Error: ./spellfix: undefined symbol: sqlite3_extension_init
>

You can specify the name of the entry point as a second argument:

    .load ./spellfix sqlite3_spellfix_init

The error you are getting is because SQLite is trying to use the entry
point name "sqlite3_extension_init" which is not exported by the "spellfix"
module.

SQLite will normally guess the right entry point name, if you are using a
recent version of SQLite and you name your shared library
"libspellfix.so".  I'm not sure if it can guess the right name with the
shared library being called just "spellfix" or not.  I think I would
definitely want to add the ".so" suffix at least.  But it never hurts to
play it safe and specify the entry point name explicitly.


>
> I really have very few knowledge about compiling c programs. Did i do some
> mistake about compiling or something else is happened? What should i do?
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to