I am attempting to use the carray loadable extension in the sqlite3 shell but I get the dreadful message: Error: %1 is not a valid Win32 application.
I don't know if this is an sqlite issue or something else. I have already read through the official docs and several related SO questions (for example here), but according to these resources it appears that I'm already doing everything right.
I've downloaded the carray source code, and compiled it successfully with MSVC. The compile options are shown here, including the path to sqlite3ext.h
and sqlite3.h
in "\src":
cl carray.c /I..\src /link /dll /out:carray.dll
This generates: carray.dll
, carray.obj
, carray.lib
, and carray.exp
.
With the sqlite3 shell started in the same directory as the compiled code, I get the following errors - trying a few different ways to load the compiled extension:
C:\SQLite\src\ext>sqlite3
SQLite version 3.16.2 2017-01-06 16:32:41
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .load carray ----- Try without the extension.
Error: %1 is not a valid Win32 application.
sqlite> .load carray.dll ----- Oh, I should use the extension.
Error: The specified module could not be found.
sqlite> .load ./carray ----- OK...maybe? Nope.
Error: %1 is not a valid Win32 application.
sqlite> SELECT load_extension('./carray.dll'); ----- Time to ask SO.
Error: The specified module could not be found.
I've tried recompiling using different options to specify the system architecture, but I get the same errors. Any hints?
System Details: SQLite 3.16.2, Windows 10 64-bit, MS Visual Studio 14 (2015)