My approachs to SQLCipher: compiling

360 views
Skip to first unread message

Hernan Cano

unread,
Oct 20, 2013, 4:28:08 PM10/20/13
to sqlc...@googlegroups.com

Thanks for this library.

I run your instructions from [[ thebugfreeblog.blogspot.com/2012/08/compiling-sqlcipher-for-windows.html ]] .

From the command line of cygwin and I receive the following messages:

export CC=i686-pc-mingw32-gcc

((no message))

cd sqlcipher_sources

((no message))

$ ./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -ID:\openssl_binaries/include" LDFLAGS="d:\openssl_binaries/lib/libeay32.lib /usr/lib/gcc/i686-pc-mingw32/4.5.2/libgcc.a"

checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking for gcc... i686-pc-mingw32-gcc
checking whether the C compiler works... no
configure: error: in `/cygdrive/d/sqlcipher_sources':
configure: error: C compiler cannot create executables
See `config.log' for more details

$ i686-pc-mingw32-gcc -DSQLITE_HAS_CODEC -I/cygdrive/c/OpenSSL-Win32/include -DSQLITE_OS_WIN=1 -I. -I./src -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DHAVE_READLINE=0 -o .libs/sqlite3.exe ./src/shell.c /usr/lib/gcc/i686-pc-mingw32/4.5.2/libgcc.a ./.libs/libsqlite3.a -lpthread -L/usr/local/lib /cygdrive/c/OpenSSL-Win32/lib/libeay32.lib

i686-pc-mingw32-gcc: error: /usr/lib/gcc/i686-pc-mingw32/4.5.2/libgcc.a: No such file or directory
i686-pc-mingw32-gcc: error: ./.libs/libsqlite3.a: No such file or directory
i686-pc-mingw32-gcc: error: /cygdrive/c/OpenSSL-Win32/lib/libeay32.lib: No such file or directory

And inside d.\sqlcipher_sources I do not find the lib directory nor any library, nor any sqlite3 executable, as you mencioned.

Can anyone tell me what has happend?

Thanks.

HERNAN CANO MARTINEZ
Systems Analyst - Programmer
Medellín, Antioquia, Colombia

Sife Abdelrazak

unread,
Oct 20, 2013, 5:10:50 PM10/20/13
to sqlc...@googlegroups.com
Hello Mr Hernan,
You are mixing forward and backward slashes in your configure command, you sould use only forward slashes.
 I had wrote HOW-TO compile sqlcipher for before but it has been delete from my wiki with out any notice, any way this instruction should work for you:
OpeenSSL development+binary, I used version 0.9.8.
http://sourceforge.net/projects/gnuwin32/files/openssl/0.9.8h-1/openssl-0.9.8h-1-setup.exe/download
MinGW32 MSYS.
http://garr.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/msys-1.0.17-1/msysCORE-1.0.17-1-msys-1.0.17-bin.tar.lzma
Sqlcipher, I used version 1.1.8.
https://nodeload.github.com/sjlombardo/sqlcipher/zipball/master
Tcl version >= 8.4.
http://downloads.activestate.com/ActiveTcl/releases/8.5.11.0/ActiveTcl8.5.11.0.295402-win32-ix86-threaded.exe
1) Setting the path environment
After installing the packages, we need setup the PATH variable for this packages. My installed packages path appears like this:
C:\Tcl\bin
C:\MinGW\bin
C:\OpenSSL\bin
C:\Tcl\bin

So, open the command prompt and type this:
set path=C:\Tcl\bin;C:\MinGW\bin;C:\OpenSSL\bin;C:\Tcl\bin;C:\Qt\4.7.4\bin
Now go to the path where MSYS installed, find etc directory, open it and edit fstab with text editor(notepad will be enough), then set this lines:
c:/MinGW /mingw
C:/Tcl            /tcl
C:/Qt/4.7.4        /qt
c:/             /c

Generally MSYS will be install in c:\ partition.
Now, extract sqlcipher  in c:\ , name it to sqlcipher so it will be appear like this:
c:\sqlcipher
2) Install OpenSSL
Go to C:\OpenSSL\bin and copy libeay32.dll to C:\OpenSSL.
Click on start menu, chose programs then MinGW, then MSYS, finaly MSYS. It should be now open to you msys shell.
3) Building sqlcipher
Cd’s to sqlcipher and build it:
cd /c/sqlcipher
./configure --prefix=/qt/src/plugins/sqldrivers/sqlcipher --disable-tcl  --disable-amalgamation CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -I/c/OpenSSL/include /c/OpenSSL/bin/libeay32.dll -L/c/OpenSSL/lib"  LDFLAGS="-leay32"

make
make dll
make install

Inside .lib drectory you will find a static library for sqlcipher.


--
 
---
You received this message because you are subscribed to the Google Groups "SQLCipher Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlcipher+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Hernan Cano

unread,
Oct 20, 2013, 6:47:28 PM10/20/13
to sqlc...@googlegroups.com
The only parts where I neede to change your script where
D:\openssl_binaries and
D:\sqlcipher_sources,
but I didn't realize about this backslash.
It is something very fastidious in Linux/Mac/OS, 'cause I'm Windows user.

I'll try to follow this instructions you give me.

If you put (some time ago) a doc on a wiki, but erased (understandable existing a commercial version), put it on another url.

Thanks.


2013/10/20 Sife Abdelrazak <sife...@gmail.com>
Reply all
Reply to author
Forward
0 new messages