Creating a Windows .lib file for SQLite for use with Visual Studio

Recently I needed to grab the latest version of SQLite3 for use in work projects. Problem is, its  pre-built Windows DLL package only comes with two files: sqlite3.dll and sqlite3.def. There is no sqlite3.lib. 

Turns out you can generate sqlite3.lib from the .def file. Here are the steps.

1) Launch the Visual Studio Command Prompt. For Visual Studio 2010, you can find it here:

Start menu -> All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt

2) cd to the directory containing your downloaded and expanded “Precompiled Binaries for Windows” sqlite dll package. You can find these packages on the downloads page for SQLite. 

Enter the following command:

lib /def:sqlite3.def /out:sqlite3.lib

Viola, you’re done! You now have a .lib file that matches the .dll.

Advertisement
Privacy Settings

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s