SQLite Forum

Compiling amalgamation with Visual Studio 2019
Login
This answer is for anybody having difficulty with the (thread) subject.

When Visual Studio is installed, there are many feature options. At an early stage of the installation, these options can be selected via a dialog box. The same dialog is presented when an existing installation is modified (by launching the "Visual Studio Installer", a shortcut placed in the "Visual Studio 20##" folder in the Start Menu.) The option, "Desktop development with C++" must be checked. There are suboptions, most of which are not strictly needed to compile SQLite. The suboptions tagged "MSVC v### ..." and "Windows ## SDK ..." should be checked. Then the installation (or its modification) can be told to proceed to completion.

If the installation for it has been done, the Start Menu will have a folder tagged "Visual Studio 20##" which contains one or more shortcuts tagged "... Tools Command Prompt" where the elided part indicates various combinations of host and target platform (x86 or x64) and "Native" or "Cross" compilation.

Launching one of those "... Tools ..." shortcuts will start a command-line shell, cmd.exe, known as "the command prompt" or sometimes (incorrectly) "DOS prompt". That shell will have its INCLUDE, LIB, LIBPATH and PATH environment variables set or modified such that useful command-line tools such as CL.exe, LINK.exe, LIB.exe, RC.exe, DUMPBIN.exe and NMAKE.exe can be found among the directories named in %PATH% and those tools can find "#include <whatever.h>" header files and commonly used system link libraries, among others.

To build the SQLite library or its shell, sqlite3.exe, <u>[How To Compile SQLite](https://sqlite.org/howtocompile.html)</u> should be studied and heeded. There, the use of an NMAKE script, "Makefile.msc", distributed with the "sqlite-autoconf-3######.tar.gz" forms of the amalgamation archive is described. Building with MSVC without the benefit of that makefile is a complex subject, best left to experts or those willing to learn NMAKE and study that makefile.

The makefile implements many build options and targets. By default, it builds the sqlite3.exe CLI shell with the SQLite library statically linked. It can be told to build the library as a DLL. Debug and normal builds can be specified. To see all the options, learn rudimentary "make" syntax and study the makefile.