You have to add the carray.c and core_init functions right at the end of the 
file (not inside any other code blocks).

The way you have it the carray.c is included only if SQLITE_ENABLE_STMTVTAB is 
enabled.

So it should look like this:

#endif /* SQLITE_CORE */
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */

/************** End of stmt.c
************************************************/

#include carray.c

>
>
>I then added the following code to the end of carray.c
>
>int core_init(const char* dummy)
>{
>       int nErr = 0;
>
>       nErr += sqlite3_auto_extension((void*)sqlite3_carray_init);
>
>       return nErr ? SQLITE_ERROR : SQLITE_OK;
>}
>

These are specified as defines to the compiler correct?  I don't think that the 
-DSQLITE_CORE is required because technically the amalgamation sqlite3.c 
defines it automatically ... I just specify it for the greater certainty.

-DSQLITE_CORE
-DSQLITE_EXTRA_INIT=core_init


---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of curmudgeon
>Sent: Monday, 21 August, 2017 09:13
>To: sqlite-users@mailinglists.sqlite.org
>Subject: Re: [sqlite] Compiling spellfix for sqlite3
>
>Keith, I know this is an old post but it refers to something we
>discussed
>recently.
>
>I tried the following
>
>I added the #include carray.c line to just above the bottom of the
>amalgamation such that the last few lines are
>
>#include carray.c
>
>#endif /* SQLITE_CORE */
>#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
>
>/************** End of stmt.c
>************************************************/
>
>
>
>I then added the following code to the end of carray.c
>
>int core_init(const char* dummy)
>{
>       int nErr = 0;
>
>       nErr += sqlite3_auto_extension((void*)sqlite3_carray_init);
>
>       return nErr ? SQLITE_ERROR : SQLITE_OK;
>}
>
>-DSQLITE_CORE
>-DSQLITE_EXTRA_INIT=core_init
>
>
>Everything compiled OK but when I tried to access carray in a query I
>got a
>"no such table" error. To be honest I had no idea where to put what
>and,
>through debugging, I know the core_init function was never entered.
>Can you
>tell me where I'm going wrong?
>
>
>
>
>--
>View this message in context:
>http://sqlite.1065341.n5.nabble.com/Compiling-spellfix-for-sqlite3-
>tp70656p97003.html
>Sent from the SQLite mailing list archive at Nabble.com.
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to