crystal-sqlite3 icon indicating copy to clipboard operation
crystal-sqlite3 copied to clipboard

Add DLL name to `@[Link]` annotation

Open HertzDevil opened this issue 3 months ago • 5 comments

This is required on MSVC to copy the correct DLL to the output directory.

This assumes the DLL is the official sqlite-dll-win-x64-*.zip download.

HertzDevil avatar Nov 12 '25 00:11 HertzDevil

The official repository has a Makefile.msc NMAKE file, which is pretty much MSVC-exclusive, so it is hard to imagine them using something like this instead to build the official binaries.

The DLL itself does not depend on any C or C++ runtime library.

HertzDevil avatar Nov 12 '25 18:11 HertzDevil

For the record: I tried building the specs on Windows in GitHub Actions with crystal-lang/install-crystal to install Crystal and choco install sqlite to install the library (it installs the .DLL and the .EXE) but crystal spec fails with:

Cannot locate the .lib files for the following libraries: sqlite3

There's indeed no .lib file installed.

ysbaddaden avatar Nov 13 '25 14:11 ysbaddaden

I don't know about Choco, but from the official download you have to do something like lib /def:sqlite3.def inside an MSVC developer prompt to get the import library. There is probably a MinGW-w64 equivalent too but it is unnecessary with MSYS2

HertzDevil avatar Nov 13 '25 14:11 HertzDevil

Thanks. It's packaging the original zip file, so I need to figure out how to start the developer console, run the command, and check if the folder is found :sweat:

ysbaddaden avatar Nov 13 '25 15:11 ysbaddaden

MinGW: dlltool.exe -d sqlite3.def -D sqlite3.dll -l sqlite3-dynamic.lib LLVM: llvm-dlltool.exe -d sqlite3.def -D sqlite3.dll -l sqlite3-dynamic.lib

HertzDevil avatar Nov 13 '25 23:11 HertzDevil

Should we merge this?

straight-shoota avatar Jan 24 '26 10:01 straight-shoota