【发布时间】:2018-09-10 22:09:34
【问题描述】:
我正在尝试加载 extension-functions sqlite3 扩展。 C文件可以在底部找到here。
我正在运行 win10 并使用 VS2015。我已将 32 位和 64 位版本编译(没有错误)为 .dll,并尝试使用 sqlite3 shell 加载它们,但出现相同错误。 (分别使用 sqlite3.dll 文件的 32 位和 64 位版本)。下面我尝试使用 32 位 sqlite 加载扩展。
sqlite> select load_extension('C:\sqlite\ext32.dll');
Error: The specified procedure could not be found.
sqlite> select load_extension('C:\sqlite\ext64.dll');
Error: The specified module could not be found.
我使用这个命令来编译 32bit cl extension-functions.c -link -dll -out:ext32.dll。然后我运行 vcvarsall x64 并运行 cl extension-functions.c -link -dll -out:ext64.dll 以获得 64 位版本。
【问题讨论】:
-
放弃扩展?而且由于您没有提供路径,因此请确保它位于您的 sqlite3 shell 的工作目录中。
-
我想使用扩展给出的中值函数...我还更新了我的帖子以显示 64 位和 32 位之间的错误差异,并确保 dll 在路径中。
-
文档指出“出于安全原因,加载的扩展程序默认关闭,必须通过事先调用
sqlite3_enable_load_extension()来启用”。也就是说,您应该重新构建 sqlite3 程序以允许加载扩展。 -
Note that the command-line shell program has already enabled extension loading for you (by calling the sqlite3_enable_load_extension() interface as part of its setup) so the command above works without any special switches, setup, or other complications.