Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use this shard on Windows 10 #93

Open
Heaven31415 opened this issue Sep 23, 2023 · 2 comments
Open

How to use this shard on Windows 10 #93

Heaven31415 opened this issue Sep 23, 2023 · 2 comments

Comments

@Heaven31415
Copy link

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
Copy link

You should look this.

@gn36
Copy link

gn36 commented Apr 21, 2024

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:

  • Go to src/sqlite3/lib_sqlite3.cr
  • Change the @[Link("sqlite3")] to @[Link("winsqlite3")]

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants