Creating static libraries and static linking with MSVC Build Tools on Windows

Solution 1:

Ok, after further exploration, it seems I have the answers.

The first question was asked here before here, and there is an interesting comment related to libraries created with MinGW (one more relevant MinGW-related question). There are several options, and the simplest appears to be lib /list sqlite3.lib, which should list objects for a static library and produce no output for the import library.

The answer to the second question is given by Misrosoft, stating that
The default mode for LIB is to build or modify a library of COFF objects. LIB runs in this mode when you do not specify /EXTRACT (to copy an object to a file) or /DEF (to build an import library).

The third question was discussed before here, and it appears that the answer is "yes". Come to think of it, a static library should contain the actual objects and no information about a DLL (which could have been created independently). The lib file is not good for use at run-time either way, so the only possibility for successful linking against static libraries should be the static mode.