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 rror LNK2001: 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: Unresolved external symbol Sqlite3_rtree_query_callback
for the first 6 functions, you must define the Sqlite_enable_column_metadata is able to export functions, in general, these functions, we can be deleted directly in the sqlite3.def file, do not export
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
Create a SQLite dll and Lib