To build a DLL of SQLite for use in Windows, first acquire the appropriate amalgamated source code files, sqlite3.c and sqlite3.h. These can either be downloaded from the http://www.sqlite.org/download.html or custom generated from sources as shown above
To build a DLL of SQLite for use in Windows, first acquire the appropriate amalgamated source code files, sqlite3.c and sqlite3.h. These can either be downloaded from the SQLite website or custom generated from sources as shown above.
:With source code files in the working directory, a DLL can be generated using MSVC with the following command
cl sqlite3.c -link -dll -out:sqlite3.dll#
The above command should be run from the MSVC Native Tools Command Prompt. If you have MSVC installed on your machine, you probably have multiple versions of this Command Prompt, for native builds for x86 and x64, and possibly also for cross-compiling to ARM. Use the appropriate Command Prompt depending on the desired DLL.
If using the MinGW compiler, the command-line is this:
gcc -shared sqlite3.c -o sqlite3.dll#
Note that MinGW generates 32-bit DLLs only. There is a separate MinGW64 project that can be used to generate 64-bit DLLs. Presumably the command-line syntax is similar. Also note that recent versions of MSVC generate DLLs that will not work on WinXP and earlier versions of Windows. So for maximum compatibility of your generated DLL, MinGW is recommended. A good rule-of-thumb is to generate 32-bit DLLs using MinGW and 64-bit DLLs using MSVC.
Os - Optimize for size. Make the DLL as small as possible
-O2 - Optimize for speed. This will make the DLL larger by unrolling loops and inlining functions
Source
http://www.sqlite.org
کلمات کلیدی: