SQLite Forum

Compile sqlite3.dll with FOREIGN_KEYS=ON as default
Login

Compile sqlite3.dll with FOREIGN_KEYS=ON as default

(1) By anonymous on 2020-09-14 22:03:22 [link] [source]

How do I compile sqlite3.dll (Windows) with FOREIGN_KEYS=ON as default?

(2) By Keith Medcalf (kmedcalf) on 2020-09-14 22:19:57 in reply to 1 [source]

However you are compiling sqlite3.dll define the symbol SQLITE_DEFAULT_FOREIGN_KEYS=1 when compiling sqlite3.c

Further detail requires further detail.

(3) By Keith Medcalf (kmedcalf) on 2020-09-14 22:23:08 in reply to 1 [link] [source]

(4) By Keith Medcalf (kmedcalf) on 2020-09-14 22:35:31 in reply to 3 [link] [source]

Note that the commands for compiling a Windows DLL are defective. You must specify at least the symbol SQLITE_API=__declspec(dllexport) in order to export the symbols from the resulting dll.

ie,

cl -DSQLITE_API=__declspec(dllexport) /LD sqlite3.c

or

gcc -DSQLITE_API=__declspec(dllexport) -mdll sqlite3.c -o sqlite3.dll

You can specify other options as required. As for the clickey-pokey, I have no clue since I despise clickey-pokeys. Note that how you get an appropriate .lib or .a trampoline generated also varies by toolchain.