Skip to content

Instantly share code, notes, and snippets.

@zeljic
Last active May 20, 2024 18:23
Show Gist options
  • Save zeljic/d8b542788b225b1bcb5fce169ee28c55 to your computer and use it in GitHub Desktop.
Save zeljic/d8b542788b225b1bcb5fce169ee28c55 to your computer and use it in GitHub Desktop.
Build SQLite3 .lib file on windows

How to build SQLite3 .lib file on Windows 10

  1. Download source from source

    For example: source https://www.sqlite.org/2023/sqlite-amalgamation-3430100.zip

  2. Download binary from binary

    For example: binary https://www.sqlite.org/2023/sqlite-dll-win64-x64-3430100.zip

  3. Extract both archives to the same directory

  4. Open Developer Command Prompt for VS 2017 by typing Developer Command in Windows Search

  5. Go to directory where you've extracted source code and binary files (via opened cmd)

  6. Run lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x64

Blog post

@heavenle
Copy link

nice, thank you!

@JohnnyTNguyen
Copy link

Thank you!

@zeljic
Copy link
Author

zeljic commented Sep 18, 2023

Updated to latest source and binary (version 3.43.1.)

@JulyIghor
Copy link

SQLITE_VERSION=$(echo $(curl -s 'https://www.sqlite.org/download.html') | awk '{ sub(".*sqlite-autoconf-",""); sub("\\.tar.*",""); sub("/.*",""); print; }')

DLL_URL="https://www.sqlite.org/`date +"%Y"`/sqlite-dll-win64-x64-${SQLITE_VERSION}.zip"
SOURCE_URL="https://www.sqlite.org/`date +"%Y"`/sqlite-amalgamation-${SQLITE_VERSION}.zip"

@Leow12487
Copy link

Hi Everyone, I have a issue about the final command , it says ### fatal error LNK1104: cannot open file 'sqlite3.def'
Here is the picture

Fatal Error 2023 - 12 - 19

@zeljic
Copy link
Author

zeljic commented Dec 19, 2023

You are in wrong directory, you are executing lib command in C:\Program Files\Microsoft Visual Studio\2022\Community but you should first move to D:\sqlite-amalgamation-3430100

@Leow12487
Copy link

Issue solved ,thank you @zeljic

@hunter2009pf
Copy link

thank you, sir~

@KerwinChina
Copy link

thank you

@thefox61
Copy link

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment