1. Sqlite3 obtain library

Download page:

https://www.sqlite.org/download.html

Need to download both packages: Pre-release Snapshots and Precompiled Binaries for Windows (in 32-bit and 64-bit, 32-bit here)

 

 Let me talk about the first downloadable package sqlite-dll-win32-x86-3300100.zip there are two documents, namely sqlite3.dll and sqlite3.def. After get the dll file, usually there are two ideas:

1) directly using LoadLibrary dynamic loading;

2) to generate an import library .lib file with the .dll file static loading.

The first way is too much trouble, generally recommended to adopt the second, it is necessary to get lib files.

These two files into a folder, for example E: \ VSProjects \ Sqlite3Lib, open Visual Studio developers command prompt, change to the directory, execute the command:

LIB /def:sqlite3.def

 

 Get the import and export libraries sqlite3.lib libraries sqlite3.exp

 

 

 If you are using MinGW gcc, you can use:

dlltool --def sqlite3.def --dllname sqlite3.dll --output-lib sqlite3.lib

Then you can get an import library file sqlite3.lib (no .exp file)

Whichever tool chain use, after getting lib file, we can use in your own programs, but before use, we also need the header file support, this can be found in the latest source code, it is used here the first package sqlite-snapshot-201912260110.tar.gz inside sqlite3.h file, put it into .dll files together.

Guess you like

Origin www.cnblogs.com/castor-xu/p/12177706.html