SQLite Forum

SQLite3 Extension
Login
I got that very old, contributed extension to compile/link to a DLL which could be loaded as a SQLite extension without explicitly stating the entry point. To do that, I had to correct for two deviations in extension-functions.c from the guidance published as [Programming Loadable Extensions](https://sqlite.org/loadext.html#write). These deviations are: 

(1) There is nothing to mark the sqlite3_extension_init() function as one to be exported as an entry point in the DLL, for which purpose the guidance recommends the preface:<code>
\#ifdef _WIN32
__declspec(dllexport)
\#endif
</code>
That alteration suffices to get the would-be entry point to appear in the output of dumpbin /exports .

(2) The sqlite3_extension_init() function's name does not adhere to the guidance suggestion, "You will do well to customize the name of your entry point to correspond to the name of the shared library you will be generating, rather than using the generic "sqlite3_extension_init" name."  Unless the extension DLL happens to be named "extension.dll", this deviation will make it necessary to supply the actual entry point name as a second argument to the load extension call, (whether that be use of the .load command or the load_extension(X,Y) form of built-in SQL function.)