SQLite lesson Fourth Creating a Windows dynamic Library

Source: Internet
Author: User
Tags sqlite win32

Download the source code package of two:

Sqlite-dll-win32-x86-3081101.zip, which provides a file that exports sqlite3 functions sqlite3.def

primarily used to generate LIB file to determine the link usage

Sqlite-preprocessed-3081101.zip, provided source files, but delete shell.c and tclsqlite3.c files

1. New Win32 console program, name sqlite3

2. Select Build DLL

3. unzip the tarball and copy the sqlite-preprocessed-3081101 files to the project folder (except shell.c and tclsqlite.c).

4. Add the source to the compiled project by adding the existing file

5 Set the module definition file sqlite3.def, otherwise the generated DLL does not have a corresponding lib

7. add pre-defined options sqlite_core,sqlite_enable_column_metadata,sqlite_enable_rtree, this is sqlite3 the macro definition.

8. Press F7 to generate the appropriate DLLs and Lib.

Compile small details:

Specify the function's export file:sqlite3.defs

Properties "linker" input "module definition file (sqlite3.def), note that in this case,the sqlite3.def file and the compilation environment are peer.

consequence: sqlite3.lib files are not generated

To specify a precompiled macro:

Properties " C + + "preprocessor" "pre-definition"

Sqlite_core

Sqlite_enable_column_metadata

Sqlite_enable_rtree

Consequences:

1>sqlite3.def:e unresolved external symbol sqlite3_column_database_name

1>sqlite3.def:error LNK2001: Unresolved external symbol Sqlite3_column_database_name16

1>sqlite3.def:error LNK2001: Unresolved external symbol sqlite3_column_origin_name

1>sqlite3.def:error LNK2001: Unresolved external symbol Sqlite3_column_origin_name16

1>sqlite3.def:error LNK2001: Unresolved external symbol sqlite3_column_table_name

1>sqlite3.def:error LNK2001: Unresolved external symbol Sqlite3_column_table_name16

1>sqlite3.def:error LNK2001: Unresolved external symbol Sqlite3_rtree_geometry_callback

1>sqlite3.def:error LNK2001:  external symbols unresolved Sqlite3_rtree_query_ Callback

front 6 functions, you must define the Sqlite_enable_ Column_metadata Sqlite3.def file deleted, not exported

after 2 functions, you must define the Sqlite_enable_rtree to be able to export the function, if we do not apply R -Tree Spatial search function, these functions, we can directly in the Sqlite3.def files are removed, not exported


SQLite lesson Fourth Creating a Windows dynamic Library

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.