# Build issues 4.2.0 on Windows VS 2017

**URL:** <https://discuss.zetetic.net/t/build-issues-4-2-0-on-windows-vs-2017/3703>\
**Category:** SQLCipher\
**Created:** [June 2, 2019, 4:10pm UTC](https://discuss.zetetic.net/t/build-issues-4-2-0-on-windows-vs-2017/3703 "2019-06-02T16:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtissington](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mtissington](https://discuss.zetetic.net/u/mtissington)\
**Post date:** [June 2, 2019, 4:10pm UTC](https://discuss.zetetic.net/t/build-issues-4-2-0-on-windows-vs-2017/3703/1 "2019-06-02T16:10:47Z")

</div>

I’ve been successfully build SQLCipher using a batch file until the latest release when it fails with a bunch of errors.

I kick things off with

nmake /f …\Makefile.msc TOP=… USE\_CRT\_DLL=1 WIN32HEAP=1

then I get the following errors …

C:\GitHub\sqlcipher\bld\>copy /Y sqlite3.h tsrc  
1 file(s) copied.  
for %i in () do copy /Y %i tsrc  
copy /Y fts5.c tsrc  
1 file(s) copied.  
copy /Y fts5.h tsrc  
1 file(s) copied.  
del /Q tsrc\sqlite.h.in tsrc\parse.y 2\>NUL  
tclsh …\tool\vdbe-compress.tcl \< tsrc\vdbe.c \> vdbe.new  
move vdbe.new tsrc\vdbe.c  
1 file(s) moved.  
echo \> .target\_source  
copy /Y tsrc\sqlite3ext.h sqlite3ext.h  
1 file(s) copied.  
tclsh …\tool\mksqlite3c.tcl  
copy …\ext\session\sqlite3session.h .  
1 file(s) copied.  
cl -nologo -W4 -DINCLUDE\_MSVC\_H=1 -DSQLITE\_OS\_WIN=1 -I. -I… -I…\src -fp:precise -MD -DNDEBUG -D\_CRT\_SECURE\_NO\_DEPRECATE -D\_CRT\_SECURE\_NO\_WARNINGS -D\_CRT\_NONSTDC\_NO\_DEPRECATE -D\_CRT\_NONSTDC\_NO\_WARNINGS -DSQLITE\_WIN32\_MALLOC=1 -DSQLITE\_THREADSAFE=1 -DSQLITE\_THREAD\_OVERRIDE\_LOCK=-1 -DSQLITE\_TEMP\_STORE=1 -DSQLITE\_MAX\_TRIGGER\_DEPTH=100 -DSQLITE\_ENABLE\_FTS3=1 -DSQLITE\_ENABLE\_RTREE=1 -DSQLITE\_ENABLE\_GEOPOLY=1 -DSQLITE\_ENABLE\_JSON1=1 -DSQLITE\_ENABLE\_STMTVTAB=1 -DSQLITE\_ENABLE\_DBPAGE\_VTAB=1 -DSQLITE\_ENABLE\_DBSTAT\_VTAB=1 -DSQLITE\_INTROSPECTION\_PRAGMAS=1 -DSQLITE\_ENABLE\_DESERIALIZE=1 -DSQLITE\_ENABLE\_COLUMN\_METADATA=1 -O2 -Zi -Fosqlite3.lo -Fdsqlite3.pdb -c sqlite3.c  
sqlite3.c  
sqlite3.c(30924): error C2061: syntax error: identifier ‘CRITICAL\_SECTION’  
sqlite3.c(30931): error C2059: syntax error: ‘}’  
sqlite3.c(30986): error C2079: ‘winMutex\_staticMutexes’ uses undefined struct ‘sqlite3\_mutex’  
sqlite3.c(30999): error C2078: too many initializers  
sqlite3.c(30986): error C2078: too many initializers  
sqlite3.c(31008): error C2143: syntax error: missing ‘{’ before ‘volatile’  
sqlite3.c(31008): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int  
sqlite3.c(31011): error C2146: syntax error: missing ‘)’ before identifier ‘milliseconds’  
sqlite3.c(31011): error C2061: syntax error: identifier ‘milliseconds’  
sqlite3.c(31011): error C2059: syntax error: ‘;’  
sqlite3.c(31011): error C2059: syntax error: ‘)’  
sqlite3.c(31015): warning C4013: ‘InterlockedCompareExchange’ undefined; assuming extern returning int  
sqlite3.c(31017): error C2109: subscript requires array or pointer type  
sqlite3.c(31021): warning C4013: ‘InitializeCriticalSection’ undefined; assuming extern returning int  
sqlite3.c(31021): error C2109: subscript requires array or pointer type  
sqlite3.c(31029): warning C4013: ‘sqlite3\_win32\_sleep’ undefined; assuming extern returning int  
sqlite3.c(31041): error C2109: subscript requires array or pointer type  
sqlite3.c(31042): warning C4013: ‘DeleteCriticalSection’ undefined; assuming extern returning int  
sqlite3.c(31042): error C2109: subscript requires array or pointer type  
sqlite3.c(31104): error C2027: use of undefined type ‘sqlite3\_mutex’  
sqlite3.c(30923): note: see declaration of ‘sqlite3\_mutex’  
sqlite3.c(31106): error C2037: left of ‘id’ specifies undefined struct/union ‘sqlite3\_mutex’  
sqlite3.c(31115): error C2037: left of ‘mutex’ specifies undefined struct/union ‘sqlite3\_mutex’  
sqlite3.c(31127): error C2109: subscript requires array or pointer type  
sqlite3.c(31149): error C2037: left of ‘id’ specifies undefined struct/union ‘sqlite3\_mutex’  
sqlite3.c(31150): error C2037: left of ‘mutex’ specifies undefined struct/union ‘sqlite3\_mutex’  
sqlite3.c(31181): warning C4013: ‘EnterCriticalSection’ undefined; assuming extern returning int  
sqlite3.c(31181): error C2037: left of ‘mutex’ specifies undefined struct/union ‘sqlite3\_mutex’  
sqlite3.c(31256): warning C4013: ‘LeaveCriticalSection’ undefined; assuming extern returning int  
sqlite3.c(31256): error C2037: left of ‘mutex’ specifies undefined struct/union ‘sqlite3\_mutex’  
sqlite3.c(34345): warning C4013: ‘GetCurrentThreadId’ undefined; assuming extern returning int  
sqlite3.c(34352): error C2061: syntax error: identifier ‘sqlite3Win32Wait’  
sqlite3.c(34352): error C2059: syntax error: ‘;’  
sqlite3.c(34352): error C2146: syntax error: missing ‘)’ before identifier ‘hObject’  
sqlite3.c(34352): error C2061: syntax error: identifier ‘hObject’  
sqlite3.c(34352): error C2059: syntax error: ‘)’  
sqlite3.c(34356): error C2065: ‘DWORD’: undeclared identifier  
sqlite3.c(34356): error C2146: syntax error: missing ‘;’ before identifier ‘rc’  
sqlite3.c(34356): error C2065: ‘rc’: undeclared identifier  
sqlite3.c(34357): error C2065: ‘BOOL’: undeclared identifier  
sqlite3.c(34357): error C2146: syntax error: missing ‘;’ before identifier ‘bRc’  
sqlite3.c(34357): error C2065: ‘bRc’: undeclared identifier  
sqlite3.c(34363): error C2065: ‘rc’: undeclared identifier  
sqlite3.c(34363): error C2065: ‘WAIT\_OBJECT\_0’: undeclared identifier  
sqlite3.c(34367): error C2065: ‘rc’: undeclared identifier  
sqlite3.c(34367): warning C4013: ‘sqlite3Win32Wait’ undefined; assuming extern returning int  
sqlite3.c(34367): error C2065: ‘HANDLE’: undeclared identifier  
sqlite3.c(34367): error C2146: syntax error: missing ‘)’ before identifier ‘p’  
sqlite3.c(34367): error C2059: syntax error: ‘)’  
sqlite3.c(34369): error C2065: ‘bRc’: undeclared identifier  
sqlite3.c(34369): warning C4013: ‘CloseHandle’ undefined; assuming extern returning int  
sqlite3.c(34369): error C2065: ‘HANDLE’: undeclared identifier  
sqlite3.c(34369): error C2146: syntax error: missing ‘)’ before identifier ‘p’  
sqlite3.c(34369): error C2059: syntax error: ‘)’  
sqlite3.c(34372): error C2065: ‘rc’: undeclared identifier  
sqlite3.c(34372): error C2065: ‘WAIT\_OBJECT\_0’: undeclared identifier  
sqlite3.c(34374): error C2065: ‘rc’: undeclared identifier  
sqlite3.c(34374): error C2065: ‘WAIT\_OBJECT\_0’: undeclared identifier  
sqlite3.c(45637): error C2061: syntax error: identifier ‘HANDLE’  
sqlite3.c(45641): error C2061: syntax error: identifier ‘lastErrno’  
sqlite3.c(45641): error C2059: syntax error: ‘;’  
sqlite3.c(45656): error C2061: syntax error: identifier ‘hMap’  
sqlite3.c(45656): error C2059: syntax error: ‘;’  
sqlite3.c(45661): error C2059: syntax error: ‘}’  
sqlite3.c(45671): error C2061: syntax error: identifier ‘BOOL’  
sqlite3.c(45672): error C2059: syntax error: ‘}’  
sqlite3.c(45795): error C2061: syntax error: identifier ‘HANDLE’  
sqlite3.c(45796): error C2061: syntax error: identifier ‘bOwned’  
sqlite3.c(45796): error C2059: syntax error: ‘;’  
sqlite3.c(45800): error C2059: syntax error: ‘}’  
sqlite3.c(45807): error C2079: ‘win\_mem\_data’ uses undefined struct ‘winMemData’  
sqlite3.c(45815): error C2065: ‘FALSE’: undeclared identifier  
sqlite3.c(45815): error C2078: too many initializers  
sqlite3.c(45807): warning C4047: ‘initializing’: ‘int’ differs in levels of indirection from ‘void \*’  
sqlite3.c(45811): error C2078: too many initializers  
sqlite3.c(45855): error C2143: syntax error: missing ‘{’ before ‘volatile’  
sqlite3.c(45855): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int  
sqlite3.c(45882): error C2065: ‘AreFileApisANSI’: undeclared identifier  
sqlite3.c(45912): error C2065: ‘CreateFileA’: undeclared identifier  
sqlite3.c(45921): error C2065: ‘CreateFileW’: undeclared identifier  
sqlite3.c(45932): error C2065: ‘CreateFileMappingA’: undeclared identifier  
sqlite3.c(45942): error C2065: ‘CreateFileMappingW’: undeclared identifier  
sqlite3.c(45951): error C2065: ‘CreateMutexW’: undeclared identifier  
sqlite3.c(45960): error C2065: ‘DeleteFileA’: undeclared identifier  
sqlite3.c(45968): error C2065: ‘DeleteFileW’: undeclared identifier  
sqlite3.c(45993): error C2065: ‘FlushFileBuffers’: undeclared identifier  
sqlite3.c(45998): error C2065: ‘FormatMessageA’: undeclared identifier  
sqlite3.c(46007): error C2065: ‘FormatMessageW’: undeclared identifier  
sqlite3.c(46016): error C2065: ‘FreeLibrary’: undeclared identifier  
sqlite3.c(46023): error C2065: ‘GetCurrentProcessId’: undeclared identifier  
sqlite3.c(46028): error C2065: ‘GetDiskFreeSpaceA’: undeclared identifier  
sqlite3.c(46037): error C2065: ‘GetDiskFreeSpaceW’: undeclared identifier  
sqlite3.c(46046): error C2065: ‘GetFileAttributesA’: undeclared identifier  
sqlite3.c(46054): error C2065: ‘GetFileAttributesW’: undeclared identifier  
sqlite3.c(46062): error C2065: ‘GetFileAttributesExW’: undeclared identifier  
sqlite3.c(46071): error C2065: ‘GetFileSize’: undeclared identifier  
sqlite3.c(46079): error C2065: ‘GetFullPathNameA’: undeclared identifier  
sqlite3.c(46088): error C2065: ‘GetFullPathNameW’: undeclared identifier  
sqlite3.c(46096): error C2065: ‘GetLastError’: undeclared identifier  
sqlite3.c(46107): error C2065: ‘GetProcAddress’: undeclared identifier  
sqlite3.c(46117): error C2065: ‘GetSystemInfo’: undeclared identifier  
sqlite3.c(46124): error C2065: ‘GetSystemTime’: undeclared identifier  
sqlite3.c(46129): error C2065: ‘GetSystemTimeAsFileTime’: undeclared identifier  
sqlite3.c(46138): error C2065: ‘GetTempPathA’: undeclared identifier  
sqlite3.c(46146): error C2065: ‘GetTempPathW’: undeclared identifier  
sqlite3.c(46154): error C2065: ‘GetTickCount’: undeclared identifier  
sqlite3.c(46162): error C2065: ‘GetVersionExA’: undeclared identifier  
sqlite3.c(46172): error C2065: ‘GetVersionExW’: undeclared identifier  
sqlite3.c(46180): error C2065: ‘HeapAlloc’: undeclared identifier  
sqlite3.c(46186): error C2065: ‘HeapCreate’: undeclared identifier  
sqlite3.c(46195): error C2065: ‘HeapDestroy’: undeclared identifier  
sqlite3.c(46202): error C2065: ‘HeapFree’: undeclared identifier  
sqlite3.c(46206): error C2065: ‘HeapReAlloc’: undeclared identifier  
sqlite3.c(46211): error C2065: ‘HeapSize’: undeclared identifier  
sqlite3.c(46211): fatal error C1003: error count exceeds 100; stopping compilation  
NMAKE : fatal error U1077: ‘“C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.EXE”’ : return code ‘0x2’  
Stop.

C:\GitHub\sqlcipher\bld\>

---

<div class="post-metadata">

**Author:** ![mtissington](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mtissington](https://discuss.zetetic.net/u/mtissington)\
**Post date:** [June 3, 2019, 2:11pm UTC](https://discuss.zetetic.net/t/build-issues-4-2-0-on-windows-vs-2017/3703/2 "2019-06-03T14:11:27Z")

</div>

Maybe a better question is what options do I need to set to ONLY build the sqlite3.h and sqlite3.c amalgamation.

And NOT build the dll or exe ?
