Compilation of sqlite3 static libraries and dynamic libraries under windows

Source: Internet
Author: User
Tags sqlite

1, download Sqlite3 Source: http://www.sqlite.org/download.html

Mainly Sqlite-amalgamation-xxxxxxx.zip, Sqlite-dll-win32-x86-xxxxxxx.zip, Sqlite-dll-win32-x64-xxxxxxx.zip

Dynamic Library Compilation:

PS: If there are no special requirements, you can directly use the DLL in the downloaded Sqlite-dll-*********.zip, if you do not rest assured that you compile.

1. Create Win32 project using VS2010, then select DLL and Empty project, vc6-vs2015 support under normal circumstances

2, the sqlite3.c, Sqlite3.h, sqlite3ext.h, sqlite3.def Copy to the project source file directory, the first 3 files are located in a zip, the next file is located in the last 2 zip, with which to see your target environment.

3, then through the project's resource manager to add the above 4 files to the project

4, modify the project configuration, in the configuration properties-->c/c++--> preprocessor---preprocessor definition, join

Sqlite_enable_rtree
Sqlite_enable_column_metadata

5, modify the project configuration, in the configuration Properties---the linker--and the module definition file to join the Sqlite3.def, and then compile.

Static Library Compilation:

1, create the Win32 project with VS2010, then select the static Library, remove the precompiled header, under normal circumstances vc6-vs2015 support

2, the sqlite3.c, Sqlite3.h, sqlite3ext.h, sqlite3.def Copy to the project source file directory, the first 3 files are located in a zip, the next file is located in the last 2 zip, with which to see your target environment.

3, then through the project's resource manager to add the above 4 files to the project

4, modify the project configuration, in the configuration properties-->c/c++--> preprocessor---preprocessor definition, join

Sqlite_enable_rtree
Sqlite_enable_column_metadata

5, modify the project configuration, in the configuration Properties---the linker--and the module definition file to join the Sqlite3.def, and then compile.

Use:

Introduce the Sqlite3.h header file and then link the dynamic library or the static library.

Note, however, that compiling the SQLITE3 project is consistent with the runtime of the Sqlite3 project, otherwise error LNK2005: a redefinition problem

Set the path as follows: Engineering--Properties---Configuration Properties-->c/c++--> code generation--run library

Compilation of sqlite3 static libraries and dynamic libraries under windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.