SQLite Forum

Unable to compile spellfix extension of latest tarball that uses "SQLITE_VTAB_INNOCUOUS"
Login
Heyho everybody,

I wanted to try out spellfix for a hobby project of mine. I'm not terribly familiar with C/C++ and compiling my own code, which is likely why I ran into this issue. Seeing as spellfix is a loadable extension, I figured that I would need to compile that C file into an .SO file and then somehow load it (Using: Linux - Ubuntu).

The problem I ran into is that the usual commands around the internet do not seem to work for me for the latest downloadable tarball (Here a SO Question of somebody with a similar issue: https://stackoverflow.com/questions/63694043/sqlite-extensions-error-c-to-dll-compiling). The commands I found were these:

> wget https://www.sqlite.org/src/tarball/sqlite.tar.gz

> tar xzf sqlite.tar.gz

> mkdir sqlitebld

> gcc -shared -fPIC -Wall -I. sqlite/ext/misc/spellfix.c -o sqlitebld/spellfix.so

However, that failed with the error:

> ~/dev$ gcc -shared -fPIC -Wall -I. sqlite/ext/misc/spellfix.c -o sqlitebld2/spellfix.so

>sqlite/ext/misc/spellfix.c: In function ‘spellfix1Init’:

>sqlite/ext/misc/spellfix.c:2072:31: error: ‘SQLITE_VTAB_INNOCUOUS’ undeclared (first use in this function); did you mean ‘SQLITE_STATIC’?

>       sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS);

>                               ^~~~~~~~~~~~~~~~~~~~~

>                               SQLITE_STATIC

In a last ditch effort I tried out this SO answer that targeted what I assume to be a specific release (3110100):

> wget https://sqlite.org/2016/sqlite-src-3110100.zip

> unzip sqlite-src-3110100.zip

> gcc -shared -fPIC -Wall -Isqlite-src-3110100 sqlite-src-3110100/ext
/misc/spellfix.c -o spellfix.so

This one *did* compile. 

Looking at the 3110100 spellfix.c file, that seems to be because the words "SQLITE_VTAB_INNOCUOUS" are not being used here. I assume this is about some kind of vtab feature that maybe hadn't been implemented back then?
Now I'll assume that under normal circumstances the up-to-date version of spellfix.c would compile and my machine is missing something to do so properly. My question would be what is missing/required here so that I can use an up-to-date version of spellfix?