Sqlcipher build windows 8


#1

Quite new to running code. Am trying to build sqlcipher on Windows 8 using MinGW msys method following this tutorial: http://www.jerryrw.com/howtocompile.php#

All the code seems to run fine to build sqlcipher, but when I go to test it in command prompt, I get this error:

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\Owner>cd c:\sqlcipher

c:\sqlcipher>sqlcipher test.db
sqlcipher: FATAL: Couldn't find sqlcipher.

Anyone got any ideas? The build should have created an sqlcipher executable dll file and an amalgamated sqlite3.c file. On Searching, have found sqlite3.c but no dll file. Code for build is:

./configure --with-crypto-lib=none --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC    -DSQLCIPHER_CRYPTO_OPENSSL -I/c/opensslbuild32/include /c/sqlcipher/libeay32.dll -L/c/sqlcipher/ -static-libgcc" LDFLAGS="-leay32"

make clean
make sqlite3.c
make
make dll

As I assume that the error is in the make dll code, here it is:

$ make dll
echo 'EXPORTS' >sqlite3.def
nm .libs/sqlite3.o | grep ' T ' | grep ' _sqlite3_' \
        | sed 's/^.* _//' >>sqlite3.def
gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -    I/c/opensslbuild32/include /c
/sqlcipher/libeay32.dll -L/c/sqlcipher/ -static-libgcc -DSQLITE_OS_WIN=1 -I.   -I/
c/sqlcipher/src -I/c/sqlcipher/ext/rtree -I/c/sqlcipher/ext/fts3 - D_HAVE_SQLITE_
CONFIG_H -DBUILD_sqlite -DNDEBUG  -DSQLITE_THREADSAFE=1   -shared -o  sqlite3.dll
sqlite3.def \
        -Wl,"--strip-all" .libs/sqlite3.o

#2

Hi @Tr15tan0

Can you capture the output from your ./configure command? Do you receive any errors when running that, or any of the subsequent make commands?


#3

Thanks for the quick response, Output from .configure is:

$ ./configure --with-crypto-lib=none --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC - DSQLCIPHER_CRYPTO_OPENSSL -I/c/opensslbuild32/include /c/sqlcipher/libeay32.dll -L/c/sqlcipher/ -static-libgcc" LDFLAGS="-leay32" checking build system type... i686-pc-mingw32 checking host system type... i686-pc-mingw32 checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... c:/mingw/mingw32/bin/ld.exe checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /c/MinGW/bin/nm checking the name lister (/c/MinGW/bin/nm) interface... BSD nm checking whether ln -s works... no, using cp -pR checking the maximum length of command line arguments... 8192 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for c:/mingw/mingw32/bin/ld.exe option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... file_magic ^x86 archive import| ^x86 DLL checking for ar... ar checking for strip... strip checking for ranlib... ranlib checking command to parse /c/MinGW/bin/nm output from gcc object... ok checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (c:/mingw/mingw32/bin/ld.exe) supports shared li braries... yes checking whether -lc should be explicitly linked in... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for a BSD-compatible install... /bin/install -c checking for gawk... gawk checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... unknown checking for _LARGE_FILES value needed for large files... unknown checking for int8_t... yes checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for intptr_t... yes checking for uint8_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uintptr_t... yes checking for sys/types.h... (cached) yes checking for stdlib.h... (cached) yes checking for stdint.h... (cached) yes checking for inttypes.h... (cached) yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking for fdatasync... no checking for gmtime_r... no checking for isnan... yes checking for localtime_r... no checking for localtime_s... no checking for malloc_usable_size... no checking for strchrnul... no checking for usleep... yes checking for utime... yes checking for tclsh8.6... no checking for tclsh8.5... no checking for tclsh... tclsh configure: Version set to 3.8 configure: Release set to 3.8.10.2 configure: Version number set to 3008010 checking whether to support threadsafe operation... yes checking for library containing pthread_create... no checking for crypto library to use... none checking whether to allow connections to be shared across threads... no checking whether to support shared library linked as release mode or not... no checking whether to use an in-ram database for temporary tables... no checking if executables have the .exe suffix... unknown checking for library containing tgetent... no checking for readline in -lreadline... no checking readline.h usability... no checking readline.h presence... no checking for readline.h... no checking for /usr/include/readline.h... no checking for /usr/include/readline/readline.h... no checking for /usr/local/include/readline.h... no checking for /usr/local/include/readline/readline.h... no checking for /usr/local/readline/include/readline.h... no checking for /usr/local/readline/include/readline/readline.h... no checking for /usr/contrib/include/readline.h... no checking for /usr/contrib/include/readline/readline.h... no checking for /mingw/include/readline.h... no checking for /mingw/include/readline/readline.h... no checking for library containing fdatasync... no checking for library containing dlopen... none required configure: creating ./config.status config.status: creating Makefile config.status: creating sqlcipher.pc config.status: creating config.h config.status: config.h is unchanged config.status: executing libtool commands

There are no errors that i’ve seen for that or any of the subsequent commands

I’ve uploaded a full log of all the commands and outputs used to build sqlcipher in msys here: http://s000.tinyupload.com/?file_id=07559557859685314521


#4

Hi @Tr15tan0

Thanks for the output, can you also share the content of both the root SQLCipher directory, as well as the ./libs directory following the build?


#5

Root Directory Contents:
http://s000.tinyupload.com/index.php?file_id=24605534092521994486

./libs Directory Contents:
http://s000.tinyupload.com/index.php?file_id=01135649367004718101


#6

Hi @Tr15tan0

Thank you for the additional listings. It appears the SQLCipher binary is present, can you try invoking it by typing sqlcipher.exe from the root of the source directory? It appears you typed sqlcipher before, without the .exe file extension.


#7

That’s brilliant, seem to have it up and running now. Knew it was going to be something obvious like that! Thanks for your help


#8

Hello @Tr15tan0

Thanks for getting back to us, I’m glad to hear that resolved the issue!