如何在sqlite中使用carray可加载扩展

如何在sqlite中使用carray可加载扩展,sqlite,Sqlite,我试图在sqlite3 shell中使用可加载扩展名carray,但我收到了一条可怕的消息:错误:%1不是有效的Win32应用程序。我不知道这是sqlite问题还是其他问题。我已经阅读了官方文件和一些相关的SO问题(例如),但根据这些资源,我似乎已经做了所有正确的事情 我已经下载了源代码,并成功地与MSVC。这里显示了编译选项,包括“\src”中指向sqlite3ext.h和sqlite3.h的路径: 这将生成:carray.dll,carray.obj,carray.lib和carray.ex

我试图在sqlite3 shell中使用可加载扩展名carray,但我收到了一条可怕的消息:
错误:%1不是有效的Win32应用程序。
我不知道这是sqlite问题还是其他问题。我已经阅读了官方文件和一些相关的SO问题(例如),但根据这些资源,我似乎已经做了所有正确的事情

我已经下载了源代码,并成功地与MSVC。这里显示了编译选项,包括“\src”中指向
sqlite3ext.h
sqlite3.h
的路径:

这将生成:
carray.dll
carray.obj
carray.lib
carray.exp

由于sqlite3外壳与编译代码在同一目录中启动,我遇到以下错误-尝试几种不同的方法加载编译的扩展:

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.
我尝试过使用不同的选项重新编译以指定系统架构,但是我得到了相同的错误。有什么提示吗


系统详细信息:SQLite 3.16.2,Windows 10 64位,MS Visual Studio 14(2015)

我尝试用
cl-carray.c/I..\src/link/dll/out:carray.dll
像你一样编译
carray
。而且
.load carray
对我来说毫无问题

我正在使用从下载的命令行工具(sqlite3.exe是一个32位应用程序)

可能您正在为x64使用
cl
和32位版本的
sqlite3.exe
?尝试使用“针对VS2015的developer命令提示符”而不是“VS2015 x64本机工具命令提示符”。因此,
其中cl
打印类似于
..\bin\cl.exe的内容,而不是
..\bin\amd64\cl.exe

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.