1

I downloaded and unziped https://sqlite.org/2016/sqlite-src-3110100.zip. Then when trying to build as a DLL the extension spellfix (it works on Linux though) with:

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
cd sqlite-src-3110100
cl /I"src\" ext\misc\spellfix.c /link

I get:

cl : Command line error D8003 : missing source filename

Why?

Basj
  • 41,386
  • 99
  • 383
  • 673
  • For future reference: [here](https://stackoverflow.com/a/49815419/1422096) is a detailed HOWTO + ready-to-use example for both Windows and Linux. – Basj Apr 13 '18 at 11:03

2 Answers2

1

You should try:

cl /I <path to sqlite amalgation> <path-to-spellfix.c> /link /DLL /OUT:spellfix.dll
Jacques Gaudin
  • 15,779
  • 10
  • 54
  • 75
  • Thanks @JacquesGaudin. I tried `cl /I src ext/misc/spellfix.c /link /DLL /OUT:spellfix.dll` and now `sqlite3ext.h` is successfully found but now `Cannot open include file: 'sqlite3.h': No such file or directory`. I double checked in the archive https://sqlite.org/2016/sqlite-src-3110100.zip, and no `sqlite3.h` in it. Why? – Basj Apr 13 '18 at 10:40
  • Also I found [here](https://sqlite.org/spellfix1.html) `The spellfix1 virtual table is not included in the SQLite amalgamation` – Basj Apr 13 '18 at 10:42
  • All the include files you need are here: https://www.sqlite.org/2018/sqlite-amalgamation-3230100.zip – Jacques Gaudin Apr 13 '18 at 10:45
  • Tghe `src` folder doesn't contain the required include files. – Jacques Gaudin Apr 13 '18 at 10:52
  • What if you don't have any source, because you are linking obj already built? – Sandburg May 15 '18 at 10:19
  • @Sandburg You need to invoke `LINK` directly then, something like `LINK /DLL firsti.obj second.obj third.obj /OUT:spellfix.dll` – Jacques Gaudin May 15 '18 at 11:01
0

I had the similar problem with DBeaver and jdbc driver for SQLite. And hope it will help someone to save some time.

Problems:

  1. I was not able to load extension spellfix I was receiving error "no such module spellfix1" upon execution

    select * from table1 where col1 like 'asd%'

  2. docs for SQLite are not obvious how to load extension, nor build it (this thread helped me, thank you guys but still it was not obvious since I was not coding for a very long time)

Solution:

  1. I've downloaded source of sqlite from url below, afterwards done following steps from post above but since i have x64 DBeaver I was receiving error

SQL error or missing database (%1 is not a valid Win32 application.) It was obvious that I need x64 build so the following steps I did:

a) in cmd prompt executed:

call "E:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64

amd64 param is necessary to setup build environment for x64 build

b) afterwards i used cl command:

cl /I "<path to sqlite amalgation folder>" "ext\misc\spellfix.c" /link /DLL /OUT:spellfix64.dll

cmd prompt was at location where I downloaded latest sqlite source from this URL. How did I get to that link was also a bit of a adventure :)

  1. afterwards put my dll to location and executed load_extension command in DBeaver

    select load_extension('E:/Users/Name/Downloads/SQLite/ext/spellfix64');

path where i put build version. To be able to build x64 version I needed to build with above comments.

Uhh, one more thing, you need to enable loading extensions in DBeaver on connection properties: post is here.

KeiserSoze
  • 53
  • 10