crystal-lang / crystal-sqlite3

SQLite3 bindings for Crystal
https://crystaldoc.info/github/crystal-lang/crystal-sqlite3
MIT License
139 stars 30 forks source link

How to use this shard on Windows 10 #93

Open Heaven31415 opened 1 year ago

Heaven31415 commented 1 year ago

Hi.

I'm running Crystal natively on Windows 10 and I was wondering about how to use this shard.

Right now I have a small project with successfully installed crystal-sqlite3 shard. I also have installed sqlite3 library on my system as a dll file in a folder that is added to my path. Unfortunately it seems that my setup doesn't work out of the box, because I'm getting the following error when I'm trying to run any SQLite3 related code:

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

I don't have any .lib files in my SQLite3 installation folder. I only have a single .dll file. Is there any way to make it work or do I need to install SQLite3 differently to also have those .lib files?

satler-git commented 1 year ago

You should look this.

gn36 commented 7 months ago

Maybe this still helps someone... After spending several hours trying to get the sqlite3 to link on windows by compiling my own version of it (not sure why it wasn't able to find my libraries regardless of the numerous tries (x64, x86, different locations, different names of the lib file, adapted crystal search paths), maybe some day I will find out), I modified this shard to link against "winsqlite3" instead:

Not the clean solution I was looking for, but at least it works. Winsqlite3 comes with the visual studio stuff that needs to be installed anyways on windows and I was able to link against it immediately.