Cannot compile sqlcipher on Windows 10 for UWP


#1

Hello,

I tried to compile latest sqlcipher on Windows 10 using nmake.
It is successful for x86, but it has errors for UWP:

:\CTUWP\SQLITE\sqlcipher-master>nmake /f Makefile.msc FOR_WINRT=1 FOR_UWP=1

Microsoft ® Program Maintenance Utility Version 14.00.24210.0
Copyright © Microsoft Corporation. All rights reserved.

    copy tsrc\sqlite3ext.h .
    1 file(s) copied.
    tclsh85 .\tool\mksqlite3c.tcl
    copy tsrc\shell.c .
    1 file(s) copied.
    cl -nologo -W3   -DSQLITE_OS_WIN=1 -I. -I. -I.\src  -fp:precise -DSQLITE_OS_WINRT=1 -DWINAPI_FAMILY=WINAPI_FAMILY_APP -MD -DNDEBUG -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -DSQLITE_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 -DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC=1 -DSQLCIPHER_CRYPTO_OPENSSL=1 -If:\MINERVA\SVN\UWP\inttalkcomponents\openssl\src\include  -DSQLITE_MAX_TRIGGER_DEPTH=100  -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1   -O2 -Zi -Fosqlite3.lo   -c sqlite3.c

sqlite3.c
lib.exe /NOLOGO /OUT:libsqlite3.lib sqlite3.lo
echo EXPORTS > sqlcipher.def
dumpbin /all libsqlite3.lib | tclsh85 .\tool\replace.tcl include “^\s+1 ?(sqlite3.*)$” \1 | sort >> sqlcipher.def
link.exe /DEBUG /NOLOGO /APPCONTAINER “/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\store” /DYNAMICBASE /NODEFAULTLIB:kernel32.lib mincore.lib /LIBPATH:c:\tcl\lib /LIBPATH:c:\OpenSSL-Win32-1.0.2\lib /LIBPATH:c:\OpenSSL-Win32-1.0.2\lib\VC /DLL /DEF:sqlcipher.def /OUT:sqlcipher.dll sqlite3.lo sqlite3res.lo tcl85.lib 4758cca.lib aep.lib atalla.lib capi.lib chil.lib cswift.lib gmp.lib gost.lib libeay32.lib nuron.lib padlock.lib ssleay32.lib sureware.lib ubsec.lib
Creating library sqlcipher.lib and object sqlcipher.exp
cl -nologo -W3 -DSQLITE_OS_WIN=1 -I. -I. -I.\src -fp:precise -DSQLITE_OS_WINRT=1 -DWINAPI_FAMILY=WINAPI_FAMILY_APP -MD -DNDEBUG -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -DSQLITE_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 -DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC=1 -DSQLCIPHER_CRYPTO_OPENSSL=1 -If:\MINERVA\SVN\UWP\inttalkcomponents\openssl\src\include -DSQLITE_MAX_TRIGGER_DEPTH=100 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -O2 -Zi -Fesqlcipher.exe -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DHAVE_READLINE=0 .\src\shell.c sqlite3.c /link /pdb:sqlciphersh.pdb /DEBUG /NOLOGO /APPCONTAINER “/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\store” /DYNAMICBASE /NODEFAULTLIB:kernel32.lib mincore.lib /LIBPATH:c:\tcl\lib /LIBPATH:c:\OpenSSL-Win32-1.0.2\lib /LIBPATH:c:\OpenSSL-Win32-1.0.2\lib\VC sqlite3res.lo tcl85.lib 4758cca.lib aep.lib atalla.lib capi.lib chil.lib cswift.lib gmp.lib gost.lib libeay32.lib nuron.lib padlock.lib ssleay32.lib sureware.lib ubsec.lib
shell.c
.\src\shell.c(260): warning C4013: ‘LoadLibrary’ undefined; assuming extern returning int
.\src\shell.c(260): warning C4047: ‘initializing’: ‘HINSTANCE’ differs in levels of indirection from ‘int’
.\src\shell.c(2622): warning C4013: ‘_pclose’ undefined; assuming extern returning int
.\src\shell.c(3146): warning C4013: ‘_popen’ undefined; assuming extern returning int
.\src\shell.c(3146): warning C4047: ‘=’: ‘FILE *’ differs in levels of indirection from ‘int’
.\src\shell.c(3148): warning C4113: ‘int (__cdecl *)()’ differs in parameter lists from ‘int (__cdecl *)(FILE *)’
.\src\shell.c(3536): warning C4047: ‘=’: ‘FILE *’ differs in levels of indirection from ‘int’
.\src\shell.c(3802): warning C4013: ‘system’ undefined; assuming extern returning int
.\src\shell.c(4486): warning C4013: ‘getenv’ undefined; assuming extern returning int
.\src\shell.c(4486): warning C4047: ‘=’: ‘char *’ differs in levels of indirection from ‘int’
.\src\shell.c(4491): warning C4047: ‘=’: ‘char *’ differs in levels of indirection from ‘int’
.\src\shell.c(4498): warning C4047: ‘=’: ‘char *’ differs in levels of indirection from ‘int’
.\src\shell.c(4499): warning C4047: ‘=’: ‘char *’ differs in levels of indirection from 'int’
sqlite3.c
Generating Code…
LINK : sqlcipher.exe not found or not built by the last incremental link; performing full link
shell.obj : error LNK2019: unresolved external symbol _LoadLibrary referenced in function _hasTimer
sqlcipher.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: ‘“C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE”’ : return code '0x2’
Stop.

So, the question is, what is wrong here? I want to use sqlcipher on Windows Phone also, so can it be build for ARM platform?

Thanks.


#2

Hi @Peter_Dr_Barabas

Unfortunately, we are unable to provide any public support regarding the compilation of SQLCipher for Windows UAP. Those builds tend to be more complex, and thus time consuming to debug. If your organization is interested in a prebuilt package of SQLCipher for Windows UAP, we have commercial licenses available online for purchase. Thanks!