Problems while building QGIS 2.15.0 on Windows
<p>I am following the instructions provided with the INSTALL file in QGIS-master</p>

<p>The following variable has been set to:</p>

<pre><code>PATH=%PYTHONHOME%;C:\OSGeo4W\bin\C:\OSGeo4W\apps\Python27\Lib;C:\OSGeo4W\apps\Python27\sip\PyQt4\QtXml;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files (x86)\CMake\bin;c:\cygwin;

PYTHONHOME=C:\OSGeo4W\apps\Python27

PYTHONPATH=C:\OSGeo4W\apps\Python27
</code></pre>

<p>Successfully configured and generated through cmake-gui (3.0.2)</p>

<p>I am using Visual Studio 2010 for building Release (Win32) on Win8.1 64 bit</p>

<p>The output is:</p>

<pre><code>1&gt;------ Build started: Project: ZERO_CHECK, Configuration: RelWithDebInfo Win32 ------
2&gt;------ Build started: Project: version, Configuration: RelWithDebInfo Win32 ------
3&gt;------ Build started: Project: ui, Configuration: RelWithDebInfo Win32 ------
4&gt;------ Build started: Project: qgis_core, Configuration: RelWithDebInfo Win32 ------
4 Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/src/core/CMakeLists.txt
4 CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\src\core\CMakeFiles\generate.stamp is up-to-date.
4 Generating C:/Users/Abdul/Downloads/QGIS/QGIS-master/src/core/qgscontexthelp_texts.cpp
5&gt;------ Build started: Project: pyqtcompat, Configuration: RelWithDebInfo Win32 ------
4 Traceback (most recent call last):
4   File "\OSGeo4W\apps\Python27\Lib/site.py", line 563, in &lt;module&gt;
4     main()
4   File "\OSGeo4W\apps\Python27\Lib/site.py", line 545, in main
4     known_paths = addusersitepackages(known_paths)
4   File "\OSGeo4W\apps\Python27\Lib/site.py", line 278, in addusersitepackages
4     user_site = getusersitepackages()
4   File "\OSGeo4W\apps\Python27\Lib/site.py", line 253, in getusersitepackages
4     user_base = getuserbase() # this will also set USER_BASE
4   File "\OSGeo4W\apps\Python27\Lib/site.py", line 242, in getuserbase
4     from sysconfig import get_config_var
4 ImportError: No module named sysconfig
4&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
6&gt;------ Build started: Project: qgis_gui, Configuration: RelWithDebInfo Win32 ------
7&gt;------ Build started: Project: python_module_qgis__core, Configuration: RelWithDebInfo Win32 ------
7 Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/CMakeLists.txt
7 CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\CMakeFiles\generate.stamp is up-to-date.
7 Generating core/sip_corepart0.cpp, core/sip_corepart1.cpp, core/sip_corepart2.cpp, core/sip_corepart3.cpp
7 
7&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code -1073741515.
8&gt;------ Build started: Project: pycore, Configuration: RelWithDebInfo Win32 ------
6&gt;LINK : fatal error LNK1104: cannot open file '..\core\RelWithDebInfo\qgis_core.lib'
9&gt;------ Build started: Project: python_module_qgis__gui, Configuration: RelWithDebInfo Win32 ------
9 Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/CMakeLists.txt
9 CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\CMakeFiles\generate.stamp is up-to-date.
9 Generating gui/sip_guipart0.cpp, gui/sip_guipart1.cpp, gui/sip_guipart2.cpp, gui/sip_guipart3.cpp
9 
10&gt;------ Build started: Project: zzz-processing-56-depend, Configuration: RelWithDebInfo Win32 ------
.........
44&gt;------ Build started: Project: zzz-processing-22-depend, Configuration: RelWithDebInfo Win32 ------
9&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code -1073741515.
45&gt;------ Build started: Project: pygui, Configuration: RelWithDebInfo Win32 ------
46&gt;------ Build started: Project: zzz-processing-21-depend, Configuration: RelWithDebInfo Win32 ------
.........
55&gt;------ Build started: Project: zzz-db_manager-7-depend, Configuration: RelWithDebInfo Win32 ------
54 Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/plugins/db_manager/db_plugins/postgis/plugins/versioning/CMakeLists.txt
54 CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\plugins\db_manager\db_plugins\postgis\plugins\versioning\CMakeFiles\generate.stamp is up-to-date.
54 Generating ui_DlgVersioning.py
54 Traceback (most recent call last):
54   File "\OSGeo4W\apps\Python27\Lib/site.py", line 563, in &lt;module&gt;
54     main()
54   File "\OSGeo4W\apps\Python27\Lib/site.py", line 545, in main
54     known_paths = addusersitepackages(known_paths)
54   File "\OSGeo4W\apps\Python27\Lib/site.py", line 278, in addusersitepackages
54     user_site = getusersitepackages()
54   File "\OSGeo4W\apps\Python27\Lib/site.py", line 253, in getusersitepackages
54     user_base = getuserbase() # this will also set USER_BASE
54   File "\OSGeo4W\apps\Python27\Lib/site.py", line 242, in getuserbase
54     from sysconfig import get_config_var
54 ImportError: No module named sysconfig
54&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
56&gt;------ Build started: Project: zzz-db_manager-6-depend, Configuration: RelWithDebInfo Win32 ------
.........
60&gt;------ Build started: Project: zzz-db_manager-15-depend, Configuration: RelWithDebInfo Win32 ------
59 Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/plugins/db_manager/CMakeLists.txt
59 CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\plugins\db_manager\CMakeFiles\generate.stamp is up-to-date.
59 Generating ui_DlgAddGeometryColumn.py
59 Traceback (most recent call last):
59   File "\OSGeo4W\apps\Python27\Lib/site.py", line 563, in &lt;module&gt;
59     main()
59   File "\OSGeo4W\apps\Python27\Lib/site.py", line 545, in main
59     known_paths = addusersitepackages(known_paths)
59   File "\OSGeo4W\apps\Python27\Lib/site.py", line 278, in addusersitepackages
59     user_site = getusersitepackages()
59   File "\OSGeo4W\apps\Python27\Lib/site.py", line 253, in getusersitepackages
59     user_base = getuserbase() # this will also set USER_BASE
59   File "\OSGeo4W\apps\Python27\Lib/site.py", line 242, in getuserbase
59     from sysconfig import get_config_var
59 ImportError: No module named sysconfig
59&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
61&gt;------ Build started: Project: zzz-db_manager-14-depend, Configuration: RelWithDebInfo Win32 ------
.........
78&gt;------ Build started: Project: zzz-GdalTools-1-depend, Configuration: RelWithDebInfo Win32 ------
77 Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/plugins/GdalTools/tools/CMakeLists.txt
77 CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\plugins\GdalTools\tools\CMakeFiles\generate.stamp is up-to-date.
77 Generating ui_dialogAbout.py
77 Traceback (most recent call last):
77   File "\OSGeo4W\apps\Python27\Lib/site.py", line 563, in &lt;module&gt;
77     main()
77   File "\OSGeo4W\apps\Python27\Lib/site.py", line 545, in main
77     known_paths = addusersitepackages(known_paths)
77   File "\OSGeo4W\apps\Python27\Lib/site.py", line 278, in addusersitepackages
77     user_site = getusersitepackages()
77   File "\OSGeo4W\apps\Python27\Lib/site.py", line 253, in getusersitepackages
77     user_base = getuserbase() # this will also set USER_BASE
77   File "\OSGeo4W\apps\Python27\Lib/site.py", line 242, in getuserbase
77     from sysconfig import get_config_var
77 ImportError: No module named sysconfig
77&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
...
========== Build: 107 succeeded, 193 failed, 6 up-to-date, 0 skipped ==========
</code></pre>

<p>The Python errors were resolved by adding python/lib to %PATH%
Now I am getting the following errors</p>

<pre><code>67&gt;------ Build started: Project: zzz-processing-61-depend, Configuration: RelWithDebInfo Win32 ------
4&gt;spatialite.lib(alloc_cache.obj) : error LNK2019: unresolved external symbol _xmlInitParser referenced in function _spatialite_initialize
4&gt;spatialite.lib(alloc_cache.obj) : error LNK2019: unresolved external symbol _xmlCleanupParser referenced in function _spatialite_shutdown
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlFreeDoc referenced in function _splite_free_xml_schema_cache_item
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2001: unresolved external symbol _xmlFreeDoc
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSchemaFree referenced in function _splite_free_xml_schema_cache_item
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSchemaFreeParserCtxt referenced in function _splite_free_xml_schema_cache_item
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlDocGetRootElement referenced in function _sniff_payload
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2001: unresolved external symbol _xmlDocGetRootElement
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _crc32 referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_relations.obj) : error LNK2001: unresolved external symbol _crc32
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _compress referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _compressBound referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSchemaFreeValidCtxt referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSchemaValidateDoc referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSchemaNewValidCtxt referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlReadMemory referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2001: unresolved external symbol _xmlReadMemory
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSchemaParse referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSchemaNewDocParserCtxt referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlReadFile referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSetGenericErrorFunc referenced in function _gaiaXmlToBlob
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2001: unresolved external symbol _xmlSetGenericErrorFunc
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _uncompress referenced in function _gaiaXmlTextFromBlob
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlDocDumpFormatMemory referenced in function _gaiaXmlLoad
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlXPathFreeObject referenced in function _gaiaXmlGetInternalSchemaURI
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2001: unresolved external symbol _xmlXPathFreeObject
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlXPathFreeContext referenced in function _gaiaXmlGetInternalSchemaURI
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2001: unresolved external symbol _xmlXPathFreeContext
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlFreeNode referenced in function _setIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlReplaceNode referenced in function _setIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlAddChild referenced in function _setIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlNewText referenced in function _setIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlNewNode referenced in function _setIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol __imp__xmlFree referenced in function _gaiaXmlBlobSetFileId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSetNs referenced in function _addIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlNewNs referenced in function _addIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlAddPrevSibling referenced in function _addIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlAddNextSibling referenced in function _addIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSearchNs referenced in function _addIsoId
4&gt;spatialite.lib(gg_xml.obj) : error LNK2019: unresolved external symbol _xmlSearchNsByHref referenced in function _addIsoId
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2019: unresolved external symbol _xmlXPathFreeCompExpr referenced in function _gaiaIsValidXPathExpression
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2019: unresolved external symbol _xmlXPathCompile referenced in function _gaiaIsValidXPathExpression
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2019: unresolved external symbol _xmlXPathEvalExpression referenced in function _vxpath_eval_expr
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2019: unresolved external symbol _xmlXPathRegisterNs referenced in function _vxpath_eval_expr
4&gt;spatialite.lib(virtualxpath.obj) : error LNK2019: unresolved external symbol _xmlXPathNewContext referenced in function _vxpath_eval_expr
4&gt;spatialite.lib(virtualXL.obj) : error LNK2019: unresolved external symbol _freexl_get_cell_value referenced in function _vXL_create
4&gt;spatialite.lib(virtualXL.obj) : error LNK2019: unresolved external symbol _freexl_worksheet_dimensions referenced in function _vXL_create
4&gt;spatialite.lib(virtualXL.obj) : error LNK2019: unresolved external symbol _freexl_select_active_worksheet referenced in function _vXL_create
4&gt;spatialite.lib(virtualXL.obj) : error LNK2019: unresolved external symbol _freexl_get_info referenced in function _vXL_create
4&gt;spatialite.lib(virtualXL.obj) : error LNK2019: unresolved external symbol _freexl_close referenced in function _vXL_create
4&gt;spatialite.lib(virtualXL.obj) : error LNK2019: unresolved external symbol _freexl_open referenced in function _vXL_create
4&gt;spatialite.lib(gg_utf8.obj) : error LNK2019: unresolved external symbol _locale_charset referenced in function _gaiaGetLocaleCharset
4&gt;spatialite.lib(gg_utf8.obj) : error LNK2019: unresolved external symbol _libiconv_close referenced in function _gaiaConvertCharset
4&gt;spatialite.lib(gg_shape.obj) : error LNK2001: unresolved external symbol _libiconv_close
4&gt;spatialite.lib(gg_utf8.obj) : error LNK2019: unresolved external symbol _libiconv referenced in function _gaiaConvertCharset
4&gt;spatialite.lib(gg_shape.obj) : error LNK2001: unresolved external symbol _libiconv
4&gt;spatialite.lib(gg_utf8.obj) : error LNK2019: unresolved external symbol _libiconv_open referenced in function _gaiaConvertCharset
4&gt;spatialite.lib(gg_shape.obj) : error LNK2001: unresolved external symbol _libiconv_open
4&gt;C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\output\bin\RelWithDebInfo\qgis_core.dll : fatal error LNK1120: 48 unresolved externals
68&gt;------ Build started: Project: qgis_gui, Configuration: RelWithDebInfo Win32 ------
69&gt;------ Build started: Project: python_module_qgis__core, Configuration: RelWithDebInfo Win32 ------
69&gt;  Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/CMakeLists.txt
69&gt;  CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\CMakeFiles\generate.stamp is up-to-date.
69&gt;  Generating core/sip_corepart0.cpp, core/sip_corepart1.cpp, core/sip_corepart2.cpp, core/sip_corepart3.cpp
69&gt;  
69&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code -1073741515.
70&gt;------ Build started: Project: pycore, Configuration: RelWithDebInfo Win32 ------
</code></pre>

<p>I also retried installing spatialite from OSGEO4W a couple of times with the same result...</p>

<p>---update---</p>

<pre><code>&lt;omitted&gt;
47&gt;------ Build started: Project: python_module_qgis__core, Configuration: RelWithDebInfo Win32 ------
47&gt;  Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/CMakeLists.txt
47&gt;  CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\CMakeFiles\generate.stamp is up-to-date.
47&gt;  Generating core/sip_corepart0.cpp, core/sip_corepart1.cpp, core/sip_corepart2.cpp, core/sip_corepart3.cpp
47&gt;  
47&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code -1073741515.
&lt;omitted&gt;
79&gt;------ Build started: Project: python_module_qgis__gui, Configuration: RelWithDebInfo Win32 ------
79&gt;  Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/python/CMakeLists.txt
79&gt;  CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\python\CMakeFiles\generate.stamp is up-to-date.
79&gt;  Generating gui/sip_guipart0.cpp, gui/sip_guipart1.cpp, gui/sip_guipart2.cpp, gui/sip_guipart3.cpp
79&gt;  
79&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code -1073741515.
&lt;omitted&gt;
103&gt;------ Build started: Project: synccrsdb, Configuration: RelWithDebInfo Win32 ------
103&gt;  Building Custom Rule C:/Users/Abdul/Downloads/QGIS/QGIS-master/src/crssync/CMakeLists.txt
103&gt;  CMake does not need to re-run because C:\Users\Abdul\Downloads\QGIS\QGIS-master-build\src\crssync\CMakeFiles\generate.stamp is up-to-date.
104&gt;------ Build started: Project: qgisgrass7, Configuration: RelWithDebInfo Win32 ------
104&gt;     Creating library C:/Users/Abdul/Downloads/QGIS/QGIS-master-build/src/providers/grass/7/RelWithDebInfo/qgisgrass7.lib and object C:/Users/Abdul/Downloads/QGIS/QGIS-master-build/src/providers/grass/7/RelWithDebInfo/qgisgrass7.exp
103&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 255.
&lt;omitted&gt;
108&gt;------ Build started: Project: qgis, Configuration: RelWithDebInfo Win32 ------
107&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code -1073741515.
</code></pre>