Unable to load into SQLite
Unable to load into SQLite, tried on version 0.1.1 and 0.1.0 - Windows platform. SQLite version 3.45.1
sqlite> .load ./http0
Error: The specified module could not be found.
Module is in same folder as CLI. Any idea?
SQLite version 3.45.0 2024-01-15 17:01:13 (UTF-16 console I/O)
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .load fastrand0
sqlite> .load html0
Error: The specified module could not be found.
sqlite> .load http0
Error: The specified module could not be found.
sqlite> .load jsonschema0
sqlite>
I think module could not be found is talking about sqlite3.dll. On my machine I run sqlite3.exe with sqlite3.dll in the same directory as http0.dll and I am able to .load http0.
sqlite3.dll, sqlite3.dll, sqlean.exe and the libraries are all in the same directory. fasrand0 loads, html0 does not.
The released http0.dll is a 64-bit library and it compiled by mingw64 and therefore requires libwinpthread-1.dll to work.
Sometimes there is only a 32-bit version of libwinpthread-1.dll in Windows and Windows tries to mix 32- and 64-bit libraries.
The solutions are
- Build
http0.dllwith-staticC-compiler flags to built-inlibwinpthread-1go build -o http0.dll -buildmode=c-shared -ldflags="-s -w -extldflags=-static"-sand-wflags reduce a dll size by half. - Just put 64-bit
libwinpthread-1.dllto an app folder.
2. Just put 64-bit [`libwinpthread-1.dll`](https://github.com/user-attachments/files/18140545/libwinpthread-1.zip) to an app folder.
Worked flawless! Thanks little-brother.
@little-brother Works like a charm! Thanks...