SQLCipher with MinGW/MSYS?

13,344 views
Skip to first unread message

Will Parsons

unread,
Dec 23, 2009, 8:48:58 PM12/23/09
to SQLCipher Users
Hello from a new user!

First of all, thanks to Stephen Lombardo for creating and making
available SQLCipher. I've recently downloaded 1.1.0 and have
successfully (I think) incorporated it into an application that I've
been developing on FreeBSD for some years now to keep track of church
offerings. I'm the only developer and currently the only user of the
application, but I'd like to make it useful for others who would
probably want to use it under Windows. (Apart from SQLCipher, the
application can already be compiled for Windows using MinGW/MSYS.)

Has anyone succeeded in using SQLCipher under Windows? My preference
would be to use the MinGW/MSYS toolchain, but I'd be interested in any
solutions.

--
Will

Stephen Lombardo

unread,
Dec 23, 2009, 10:30:24 PM12/23/09
to sqlc...@googlegroups.com
Hi Will,

It's good to hear from you. We included a whole bunch of fixes in 1.1.0 that allow SQLCipher to be used on windows. With the latest sources I've compiled and run it successfully using both MInGW and Visual Studio.

The trickier part is getting OpenSSL going. I was not able to get a simple MinGW build of OpenSSL working due to various issues in the make system cased by MinGW's lack of symlinks. However, building OpenSSL is fairly easy if you have Visual Studio and ActiveState Perl on your system. Just run the following from the visual studio command line (ensure perl is in the path)

perl Configure VC-WIN32 --prefix=build
ms\do_masm.bat
nmake -f ms\nt.mak
nmake -f ms\ntdll.mak
nmake -f ms\nt.mak install

That will drop libeay32.dll and libeay32.lib file in build/bin. From there you can copy libeay32.dll over to your sqlcipher directory and run the sqlcipher build under msys. It's pretty standard, just disable tcl since it won't be present under a default install.

./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -I/path/to/openssl/include" LDFLAGS="-leay32"
make
make dll

That will create a working sqlite3 binary and sqlite3.dll.

I've also been successful in compiling the amalgamated sqlite3.c in a Visual Studio project and statically linking it to libeay32.lib to remove the runtime dll dependencies.

Cheers,
Stephen

==
Stephen Lombardo
http://www.zetetic.net

Will Parsons

unread,
Dec 24, 2009, 8:31:14 AM12/24/09
to sqlc...@googlegroups.com
Hi Stephen,

Thanks for the info. I have ActiveState Perl, but I don't have Visual Studio,
so it looks like I'll have to look at other means of getting OpenSSL on
Windows. For curiosity, have you tried to get SQLCipher to work under Cygwin?
I might have difficulties using Cygwin for reasons other to do with SQLCipher,
but it would be interesting to know if that part would work.

Thanks again.

Stephen Lombardo

unread,
Dec 24, 2009, 9:49:03 AM12/24/09
to sqlc...@googlegroups.com
Hi Will,

Both SQLCipher and OpenSSL will work just fine with Cygwin so that is a great option as well as long as you don't mind the dependency. One other option would be to use a pre-compiled OpenSSL DLL with MinGW so you don't have to build it from scratch: http://www.openssl.org/related/binaries.html. I haven't used it before personally, but it should work just fine with the method described below.

Cheers,
Stephen

Adriano Ribeiro

unread,
Jan 28, 2010, 6:55:13 PM1/28/10
to SQLCipher Users
Hi, Stephen

Firstly, fantastic work! I new with SQLite and mainly with SQCipher,
did you have patched amalgamated sqlite3.c? I would like to integrate
in my game engine.

thanks.

On 24 dez 2009, 12:49, Stephen Lombardo <sjlomba...@zetetic.net>
wrote:


> Hi Will,
>
> Both SQLCipher and OpenSSL will work just fine with Cygwin so that is a
> great option as well as long as you don't mind the dependency. One other
> option would be to use a pre-compiled OpenSSL DLL with MinGW so you don't
> have to build it from scratch:http://www.openssl.org/related/binaries.html.
> I haven't used it before personally, but it should work just fine with the
> method described below.
>
> Cheers,
> Stephen
>

> > > On Wed, Dec 23, 2009 at 8:48 PM, Will Parsons <gylia...@gmail.com>

Stephen Lombardo

unread,
Feb 3, 2010, 6:25:54 AM2/3/10
to sqlc...@googlegroups.com
Hi Adriano,

We don't have a prepared sqlite3.c file for use with SQLCipher. The best way to do this is to grab the source of of github from http://github.com/sjlombardo/sqlcipher, run the configuration described on our site (http://www.zetetic.net/software/sqlcipher#building), but then run

make sqlite3

That make target will generate the amalgamation file from the sources, which you can then import into your project. Note however that even if you use the sqlite3.c amalgamation you need to have your build dependencies setup properly for OpenSSL (i.e. includes and linking).

Cheers,
Stephen

Stephen Lombardo

unread,
Feb 5, 2010, 4:10:31 AM2/5/10
to sqlc...@googlegroups.com
Folks,

Some people have reported issues building SQLCipher under MinGW. The root of the issue rests with corruption of the sqlite3.h header file in the build directory. This can occur a variety of ways, but the most likely reason is performing a build without having tclsh in your path, etc. Unfortunately make will not overwrite sqlite3.h if it is present in any form. If there is a corrupted or empty sqlite3.h file you will see many gcc errors referencing invalid types, etc. 

To resolve this issue, you simply need to delete sqlite3.h from the sqlcipher directory and then run make again. However, before you do, you must ensure that if you are using the amalgamation build (the default used by configure) that you have tclsh installed. Alternately you could try to configure with --disable-amalgamation. 

Cheers,
Stephen

Yasriady

unread,
Feb 5, 2010, 8:49:33 PM2/5/10
to SQLCipher Users
Hi Stephen,

Nice to see this sqlcipher distributed widely.
Anyway, I get failed to run make under msys with following message:

...
.........
libtool: link: gcc -DSQLITE_HAS_CODEC -I/home/compile/OpenSSL/include -
DSQLITE_O
S_WIN=1 -I. -I./src -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -I/opt/tcl/
include -DSQLITE
_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 -
DSQLITE_OMIT_LOAD_EXTENSION=1 -D
HAVE_READLINE=0 -o .libs/sqlite3.exe ./src/shell.c ./.libs/
libsqlite3.a -L/usr/
local/lib
./.libs/libsqlite3.a(crypto.o):crypto.c:(.text+0xe): undefined
reference to `EVP_get_cipherbyname'
./.libs/libsqlite3.a(crypto.o):crypto.c:(.text+0x17): undefined
reference to `OPENSSL_add_all_algorithms_noconf'
./.libs/libsqlite3.a(crypto.o):crypto.c:(.text+0x514): undefined
reference to `PKCS5_PBKDF2_HMAC_SHA1'
./.libs/libsqlite3.a(crypto.o):crypto.c:(.text+0x598): undefined
reference to `RAND_pseudo_bytes'
./.libs/libsqlite3.a(crypto.o):crypto.c:(.text+0x5eb): undefined
reference to `EVP_CipherInit'
./.libs/libsqlite3.a(crypto.o):crypto.c:(.text+0x601): undefined
reference to `EVP_CIPHER_CTX_set_padding'
./.libs/libsqlite3.a(crypto.o):crypto.c:(.text+0x632): undefined
reference to `EVP_CipherInit'
...
....
.....

My configuration command is:

./configure --disable-amalgamation --disable-tcl CFLAGS="-
DSQLITE_HAS_CODEC -I/home/compile/openssl-0.9.8l/include/openssl"
LDFLAGS="-Leay32"

Note: which one the correct LDFLAGS parameter?
LDFLAGS="-leay32" (this flag return error)
or
LDFLAGS="-Leay32" (with this flag configure can working normally)
With this flag, meaning what? is it a directory? What purpose, and in
which location?

Thank you,
Dedy Yasriady


On Feb 5, 4:10 pm, Stephen Lombardo <sjlomba...@zetetic.net> wrote:
> Folks,
>
> Some people have reported issues building SQLCipher under MinGW. The root of
> the issue rests with corruption of the sqlite3.h header file in the build
> directory. This can occur a variety of ways, but the most likely reason is
> performing a build without having tclsh in your path, etc. Unfortunately
> make will not overwrite sqlite3.h if it is present in any form. If there is
> a corrupted or empty sqlite3.h file you will see many gcc errors referencing
> invalid types, etc.
>
> To resolve this issue, you simply need to delete sqlite3.h from
> the sqlcipher directory and then run make again. However, before you do, you
> must ensure that if you are using the amalgamation build (the default used
> by configure) that you have tclsh installed. Alternately you could try to
> configure with --disable-amalgamation.
>
> Cheers,
> Stephen
>

> On Wed, Feb 3, 2010 at 6:25 AM, Stephen Lombardo <sjlomba...@zetetic.net>wrote:
>
> > Hi Adriano,
>
> > We don't have a prepared sqlite3.c file for use with SQLCipher. The best
> > way to do this is to grab the source of of github from
> >http://github.com/sjlombardo/sqlcipher, run the configuration described on
> > our site (http://www.zetetic.net/software/sqlcipher#building), but then
> > run
>
> > make sqlite3
>
> > That make target will generate the amalgamation file from the sources,
> > which you can then import into your project. Note however that even if you
> > use the sqlite3.c amalgamation you need to have your build dependencies
> > setup properly for OpenSSL (i.e. includes and linking).
>
> > Cheers,
> > Stephen
>

Stephen Lombardo

unread,
Feb 16, 2010, 3:27:17 PM2/16/10
to sqlc...@googlegroups.com
Hi Yasriady,

Sorry for the delayed response. The errors you have referenced below are caused because you do not have the openssl crypto DLL available at link time. If you refer to earlier emails in this thread you will find general instructions on how to build libeay32.dll from the OpenSSL source code:


Alternately you can try one of the binaries available on the internet. Once you have libeay32.dll available you can either place it in sqlcipher directly while you compile, or add the following to your LDFLAGS options:

-L/path/to/folder/containing/dll

Please let us know if that resolves the issue you're seeing.

Cheers,
Stephen

Yasriady

unread,
Feb 22, 2010, 2:27:22 AM2/22/10
to SQLCipher Users
Hi Stephen,

I'm trying to install Windows binary "Win32OpenSSL-0_9_8l.exe" to c:
\OpenSSL and doing following step:

- copy libeay32.dll to sqlcipher directory.
- copy C:\OpenSSL\lib\MinGW to c:\MinGW\lib
- doing configure and make as follow:

./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -I/c/openSSL/
include" LDFLAGS="-leay32"
make

until here i can sucessfully get sqlite3.exe but when executing "make
dll" I got error similar as above ones.

Any idea? please do assist.

Thank you and regards,
Dedy Yasriady


On Feb 17, 3:27 am, Stephen Lombardo <sjlomba...@zetetic.net> wrote:
> Hi Yasriady,
>
> Sorry for the delayed response. The errors you have referenced below are
> caused because you do not have the openssl crypto DLL available at link
> time. If you refer to earlier emails in this thread you will find general
> instructions on how to build libeay32.dll from the OpenSSL source code:
>
> http://groups.google.com/group/sqlcipher/msg/6cc3209fb7f36ea7
>
> Alternately you can try one of the binaries available on the internet. Once
> you have libeay32.dll available you can either place it in sqlcipher
> directly while you compile, or add the following to your LDFLAGS options:
>
> -L/path/to/folder/containing/dll
>
> Please let us know if that resolves the issue you're seeing.
>
> Cheers,
> Stephen
>

Yasriady

unread,
Feb 22, 2010, 2:35:23 AM2/22/10
to SQLCipher Users
Stephen,

Regarding my previous explanation, here I send error appear on msys
compling while executing "make all"

---------------------------------------------------------------------------------------------------------------------------------------------------------

Dedy Yasriady@DDY /c/src/sjlombardo-sqlcipher-982f416
$ make dll
echo 'EXPORTS' >sqlite3.def
nm .libs/sqlite3.o | grep ' T ' | grep ' _sqlite3_' \
| sed 's/^.* _//' >>sqlite3.def
gcc -DSQLITE_HAS_CODEC -I/c/openSSL/include -DSQLITE_OS_WIN=1 -I. -
I./src -D_H
AVE_SQLITE_CONFIG_H -DNDEBUG -DSQLITE_THREADSAFE=1 -
DSQLITE_THREAD_OVERRIDE_LO
CK=-1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -shared -o sqlite3.dll
sqlite3.def \
-Wl,"--strip-all" .libs/sqlite3.o
.libs/sqlite3.o:sqlite3.c:(.text+0x4f7): undefined reference to
`PKCS5_PBKDF2_HMAC_SHA1'
.libs/sqlite3.o:sqlite3.c:(.text+0x57b): undefined reference to
`RAND_pseudo_bytes'
.libs/sqlite3.o:sqlite3.c:(.text+0x5ce): undefined reference to
`EVP_CipherInit'
.libs/sqlite3.o:sqlite3.c:(.text+0x5e4): undefined reference to
`EVP_CIPHER_CTX_set_padding'
.libs/sqlite3.o:sqlite3.c:(.text+0x615): undefined reference to
`EVP_CipherInit'
.libs/sqlite3.o:sqlite3.c:(.text+0x642): undefined reference to
`EVP_CipherUpdate'
.libs/sqlite3.o:sqlite3.c:(.text+0x678): undefined reference to
`EVP_CipherFinal'
.libs/sqlite3.o:sqlite3.c:(.text+0x694): undefined reference to
`EVP_CIPHER_CTX_cleanup'
.libs/sqlite3.o:sqlite3.c:(.text+0x7c6): undefined reference to
`EVP_get_cipherbyname'
.libs/sqlite3.o:sqlite3.c:(.text+0x7da): undefined reference to
`EVP_CIPHER_key_length'
.libs/sqlite3.o:sqlite3.c:(.text+0x7ee): undefined reference to
`EVP_CIPHER_iv_length'
.libs/sqlite3.o:sqlite3.c:(.text+0xcef): undefined reference to
`RAND_pseudo_bytes'
.libs/sqlite3.o:sqlite3.c:(.text+0xe2b): undefined reference to
`OPENSSL_add_all_algorithms_noconf'
.libs/sqlite3.o:sqlite3.c:(.text+0xe7f): undefined reference to
`OPENSSL_add_all_algorithms_noconf'
.libs/sqlite3.o:sqlite3.c:(.text+0xf33): undefined reference to
`RAND_pseudo_bytes'
collect2: ld returned 1 exit status
make: *** [sqlite3.dll] Error 1

---------------------------------------------------------------------------------------------------------------------------------------------------------

Please assist and thank you,
Dedy Yasriady


On Feb 17, 3:27 am, Stephen Lombardo <sjlomba...@zetetic.net> wrote:
> Hi Yasriady,
>
> Sorry for the delayed response. The errors you have referenced below are
> caused because you do not have the openssl crypto DLL available at link
> time. If you refer to earlier emails in this thread you will find general
> instructions on how to build libeay32.dll from the OpenSSL source code:
>
> http://groups.google.com/group/sqlcipher/msg/6cc3209fb7f36ea7
>
> Alternately you can try one of the binaries available on the internet. Once
> you have libeay32.dll available you can either place it in sqlcipher
> directly while you compile, or add the following to your LDFLAGS options:
>
> -L/path/to/folder/containing/dll
>
> Please let us know if that resolves the issue you're seeing.
>
> Cheers,
> Stephen
>

Yasriady

unread,
Feb 24, 2010, 2:13:22 AM2/24/10
to SQLCipher Users
After several trial and error, finally I could compile sqlcipher and
result sqlite3.dll in source directory.
And then, could some body give idea how to start code in C++?
I want to access sqlite database and encrypt the data as well.
I'm really new and need your guide to start with sqlcipher.........

Thank you and best regards,
Dedy Yasriady

> ...
>
> read more »

Stephen Lombardo

unread,
Feb 24, 2010, 10:58:31 PM2/24/10
to sqlc...@googlegroups.com
Hi Dedy,

Could you reply to the group with the configuration changes you made. It was clear from your earlier emails that linking was failing. Did you move the libea32.dll to the build directory, or take my suggestion to alter the library path?

Regarding the best way to start using SQLCipher, I'd suggest you take a quick look at the following tutorial. It was authored for the iPhone, but the code and sample at the end is still applicable for any platform.


Cheers,
Stephen

Yasriady

unread,
Feb 24, 2010, 10:58:45 PM2/24/10
to SQLCipher Users
I'm sorry, I made mistake while compiling as follow:
./configure --disable-tcl --disable-amalgamation CFLAGS="-
DSQLITE_HAS_CODE -I/c/OpenSSL/include" LDFLAGS="-leay32"

See at CFLAGS, this mean there was no CODEC included to sqlcipher. And
compiling will work normally without crypto included.

When I compile back using correct command:
./configure --disable-tcl --disable-amalgamation CFLAGS="-
DSQLITE_HAS_CODEC -I/c/OpenSSL/include" LDFLAGS="-leay32"

I still get similar error mentioned about no reference to crypto
library:

.libs/sqlite3.o:sqlite3.c:(.text+0x4f7): undefined reference to
`PKCS5_PBKDF2_HMAC_SHA1'
.libs/sqlite3.o:sqlite3.c:(.text+0x57b): undefined reference to
`RAND_pseudo_bytes'
.libs/sqlite3.o:sqlite3.c:(.text+0x5ce): undefined reference to
`EVP_CipherInit'
.libs/sqlite3.o:sqlite3.c:(.text+0x5e4): undefined reference to
`EVP_CIPHER_CTX_set_padding'
.libs/sqlite3.o:sqlite3.c:(.text+0x615): undefined reference to
`EVP_CipherInit'
.libs/sqlite3.o:sqlite3.c:(.text+0x642): undefined reference to
`EVP_CipherUpdate'
.libs/sqlite3.o:sqlite3.c:(.text+0x678): undefined reference to
`EVP_CipherFinal'
.libs/sqlite3.o:sqlite3.c:(.text+0x694): undefined reference to
`EVP_CIPHER_CTX_cleanup'

I made copy of libeay32.dll to sqlcipher source directory, but above
error still appear.
Can somebody point me out how to resolve this problem? Specially on
how to make compiler can linking well to crypto libray in OpenSSL ?

Anyway
Adriano, thanks for sending me VSNet project to compile amalgamated
version.
But I'm not make try to use the library since I now using VS 6.


Thank you and best regards,
Dedy Yasriady

> ...
>
> read more »

Stephen Lombardo

unread,
Feb 24, 2010, 11:07:07 PM2/24/10
to sqlc...@googlegroups.com
Hi Dedy,

Try the -L flag in the LDFLAGS assignent like this:

./configure --disable-tcl --disable-amalgamation CFLAGS="-
DSQLITE_HAS_CODE -I/c/OpenSSL/include" LDFLAGS="-leay32 -L/c/OpenSSL/lib"

Cheers,
Stephen

Yasriady

unread,
Feb 25, 2010, 3:37:28 AM2/25/10
to SQLCipher Users
Still can not work,
Similar error still appear...........

FYI: I used Win32OpenSSL-0_9_8l.exe

Any other idea?
Or some body else in this group can give me the clue, please?

On Feb 25, 11:07 am, Stephen Lombardo <sjlomba...@zetetic.net> wrote:
> Hi Dedy,
>
> Try the -L flag in the LDFLAGS assignent like this:
>
> ./configure --disable-tcl --disable-amalgamation CFLAGS="-
> DSQLITE_HAS_CODE -I/c/OpenSSL/include" LDFLAGS="-leay32 -L/c/OpenSSL/lib"
>
> Cheers,
> Stephen
>

> ...
>
> read more »

Michael Stephenson

unread,
Feb 25, 2010, 9:50:46 AM2/25/10
to sqlc...@googlegroups.com
Well, I got this working in VS 2003, but if you're using VS 6, then the same
process should theoretically work I guess.

In a nutshell, what I did was:
1) Built openssl as a static lib.
2) Built sqlite as a static lib (and tested the lib in a demo app).
3) Copied the following four files from the sqlcipher source on top of the
sqlite source: crypto.c, crypto.h, pager.c, pragma.h
4) Added the openssl lib to the sqlite project dependencies.
5) Rebuild the sqlite lib and renamed the output lib from sqlite3.lib to
sqlcipher3.lib.

To make things a little simpler, I added this to a header file, so as not to
have to manually add the sqlcipher library to other projects.

#ifdef _DEBUG
# pragma comment(lib, "sqlcipher3d.lib")
#else
# pragma comment(lib, "sqlcipher3.lib")
#endif

~Mike

Yasriady

unread,
Mar 1, 2010, 4:45:53 AM3/1/10
to SQLCipher Users
Dear groups,

Finally, after days searching and trying, I made compiled sqlchiper
with Eclipse Galileo.
Seem eclipse employing MinGW for it’s external compiler/linker, with
easier gui navigation to set compile parameter.
It could works and yield me sqlite3.dll as hoped. I took following
steps:

- In eclipse, I choose new project manage “C Project” for shared
library
- Then copy sqlite3.h, sqlite3.c and src/sqlite3ext.h into my eclipse
project
sqlite3.h and sqlite3.c is ones yielded by “make” command at msys
environment.
- Adjust eclipse property to match requirement:
[C/C++ Build] -> [Settings] -> [Tool Settings] -> [GCC C Compiler] and
supply following:
Symbol (-D) : SQLITE_HAS_CODEC
Include paths (-I) need to point out to OpenSSL include directory.
[MinGW C Linker] -> [Libraries]
Libraries (-l): eay32
Library search path (-L) need to point to OpenSSL library directory.

Stephen,
Thanks for spread sqlcipher widely and assist me to compile it.
The problem I found is mostly about linking to openssl library.
I could configure ecplise to find the "include/openssl" and “library”
search path.

Mike,
I'm not made a try your method yet, but thanks anyway for the
guide...........

Others, your comment and suggestion are welcome.

Cheers,
Dedy Yasriady


On Feb 25, 9:50 pm, "Michael Stephenson" <domehead...@gmail.com>
wrote:

> ...
>
> read more »

Dimitri

unread,
Mar 23, 2010, 7:00:44 PM3/23/10
to SQLCipher Users
Hi all,

If you have still opensll linking problems while building shared
SQLite library with SQLCipher
with MinGW/MSYS like following:


.libs/sqlite3.o:sqlite3.c:(.text+0x57b): undefined reference to
`RAND_pseudo_bytes'
.libs/sqlite3.o:sqlite3.c:(.text+0x5ce): undefined reference to
`EVP_CipherInit'
.libs/sqlite3.o:sqlite3.c:(.text+0x5e4): undefined reference to
`EVP_CIPHER_CTX_set_padding'
.libs/sqlite3.o:sqlite3.c:(.text+0x615): undefined reference to
`EVP_CipherInit'

try to use next solution:

open Makefile, scroll down and find the line for sqlite3.dll target:

sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
$(TCC) -shared -o $@ sqlite3.def \
-Wl,"--strip-all" $(REAL_LIBOBJ)

change it to next one (add the library path and name)

sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
$(TCC) -shared -o$@ sqlite3.def \
-Wl,"--strip-all" $(REAL_LIBOBJ) -LC:\PATH_TO_OPEN_SSL\lib\MinGW -
leay32

Don't forget to put your path to openssl folder.

After that build the library with the command
$ make dll

Regards,
Dimitri

> ...
>
> read more »

Stephen Lombardo

unread,
Mar 23, 2010, 10:18:01 PM3/23/10
to sqlc...@googlegroups.com
Hi Dimitri,

You will find that earlier in this thread I recommend a similar configuration, except via environmental variables. I've done some investigation here, and if you reconfigure and place the linker flags in the CFLAGS environmental variable you'll be able to build both the SQLCipher exe and dll without modifying the makefile, i.e. 

./configure --disable-tcl --disable-amalgamation CFLAGS="-DSQLITE_HAS_CODE -I/c/OpenSSL/include -leay32 -L/c/OpenSSL/lib"
make
make dll

Personally, I think this is a better way to configure the system at compile time because it doesn't require any changes to the Makefile (which could be overwritten or made obsolete by newer versions). Either way, as you've noted, the important thing is that libeay32.dll must either be in $PATH, or pointed to by the -L flag to gcc. Of course for this sort of build libeay32.dll will still need to be in the path at runtime. 

Let me know if that new command works for you. Thanks!

Cheers,
Stephen

To unsubscribe from this group, send email to sqlcipher+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

illuk

unread,
Mar 25, 2010, 12:08:43 PM3/25/10
to SQLCipher Users
Hi all. Thank you, Stephen. Your advice to reinstall msys & mingw
worked. But --disable-amalgamation had no effect. I had to build &
install tcl.
As a result 'make' command partially worked.
Unfortunately i've got the following messages...

$ make
./libtool --mode=compile --tag=CC gcc -DSQLITE_HAS_CODEC -I/c/
OpenSSL/include/
openssl -DSQLITE_OS_WIN=1 -I. -I./src -D_HAVE_SQLITE_CONFIG_H -
DNDEBUG -DSQLIT
E_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 -
DSQLITE_OMIT_LOAD_EXTENSION=1
-DSQLITE_TEMP_STORE=1 -c ./src/alter.c
libtool: compile: gcc -DSQLITE_HAS_CODEC -I/c/OpenSSL/include/openssl
-DSQLITE_
OS_WIN=1 -I. -I./src -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -


DSQLITE_THREADSAFE=1 -DSQ
LITE_THREAD_OVERRIDE_LOCK=-1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -

DSQLITE_TEMP_STORE=
1 -c ./src/alter.c -DDLL_EXPORT -DPIC -o .libs/alter.o
In file included from ./src/alter.c:15:
./src/sqliteInt.h:431: error: syntax error before "i64"
./src/sqliteInt.h:431: warning: data definition has no type or storage
class
./src/sqliteInt.h:432: error: syntax error before "u64"
./src/sqliteInt.h:432: warning: data definition has no type or storage
class
In file included from ./src/sqliteInt.h:643,
from ./src/alter.c:15:
./src/btree.h:58: error: syntax error before "sqlite3"
./src/btree.h:157: error: syntax error before "i64"
./src/btree.h:163: error: syntax error before "i64"
./src/btree.h:171: error: syntax error before "i64"
./src/btree.h:177: error: syntax error before "sqlite3_int64"
./src/btree.h:178: error: syntax error before
"sqlite3BtreeGetCachedRowid"
./src/btree.h:178: warning: data definition has no type or storage
class
./src/btree.h:192: error: syntax error before "i64"
./src/btree.h:207: error: syntax error before '*' token
./src/btree.h:217: error: syntax error before '*' token
In file included from ./src/sqliteInt.h:644,
from ./src/alter.c:15:
./src/vdbe.h:54: error: syntax error before "i64"
./src/vdbe.h:54: warning: no semicolon at end of struct or union
./src/vdbe.h:54: warning: no semicolon at end of struct or union
./src/vdbe.h:64: error: syntax error before '}' token
./src/vdbe.h:64: warning: data definition has no type or storage class
./src/vdbe.h:72: error: syntax error before '}' token
In file included from ./src/sqliteInt.h:644,
from ./src/alter.c:15:
./src/vdbe.h:167: error: syntax error before '*' token
./src/vdbe.h:199: error: syntax error before '*' token
./src/vdbe.h:199: warning: data definition has no type or storage
class
./src/vdbe.h:203: error: syntax error before '*' token
./src/vdbe.h:204: error: syntax error before '*' token
./src/vdbe.h:204: warning: data definition has no type or storage
class
In file included from ./src/sqliteInt.h:645,
from ./src/alter.c:15:
./src/pager.h:88: error: syntax error before '*' token
./src/pager.h:95: error: syntax error before ')' token
./src/pager.h:107: error: syntax error before
"sqlite3PagerJournalSizeLimit"
./src/pager.h:107: error: syntax error before "i64"
./src/pager.h:107: warning: data definition has no type or storage
class
./src/pager.h:108: error: syntax error before '*' token
./src/pager.h:108: warning: data definition has no type or storage
class
./src/pager.h:140: error: syntax error before '*' token
./src/pager.h:140: warning: data definition has no type or storage
class
./src/pager.h:141: error: syntax error before '*' token
./src/pager.h:141: warning: data definition has no type or storage
class
In file included from ./src/sqliteInt.h:648,
from ./src/alter.c:15:
./src/os.h:233: error: syntax error before '*' token
./src/os.h:234: error: syntax error before '*' token
./src/os.h:235: error: syntax error before '*' token
./src/os.h:236: error: syntax error before '*' token
./src/os.h:237: error: syntax error before '*' token
./src/os.h:238: error: syntax error before '*' token
./src/os.h:239: error: syntax error before '*' token
./src/os.h:240: error: syntax error before '*' token
./src/os.h:241: error: syntax error before '*' token
./src/os.h:242: error: syntax error before '*' token
./src/os.h:244: error: syntax error before '*' token
./src/os.h:245: error: syntax error before '*' token
./src/os.h:250: error: syntax error before '*' token
./src/os.h:251: error: syntax error before '*' token
./src/os.h:252: error: syntax error before '*' token
./src/os.h:253: error: syntax error before '*' token
./src/os.h:260: error: syntax error before '*' token
./src/os.h:261: error: syntax error before '*' token
./src/os.h:262: error: syntax error before '*' token
./src/os.h:268: error: syntax error before '*' token
./src/os.h:269: error: syntax error before '*' token
In file included from ./src/alter.c:15:
./src/sqliteInt.h:690: error: syntax error before "sqlite3"
./src/sqliteInt.h:690: warning: no semicolon at end of struct or union
./src/sqliteInt.h:794: error: syntax error before "sqlite3_vfs"
./src/sqliteInt.h:794: warning: no semicolon at end of struct or union
./src/sqliteInt.h:810: error: syntax error before "lastRowid"
./src/sqliteInt.h:810: warning: data definition has no type or storage
class
./src/sqliteInt.h:814: error: syntax error before '*' token
./src/sqliteInt.h:814: warning: data definition has no type or storage
class
./src/sqliteInt.h:815: error: `SQLITE_LIMIT_TRIGGER_DEPTH' undeclared
here (not
in a function)
./src/sqliteInt.h:829: error: syntax error before "u64"
./src/sqliteInt.h:836: error: syntax error before "sqlite_int64"
./src/sqliteInt.h:837: error: syntax error before "sqlite3"
./src/sqliteInt.h:838: error: syntax error before "sqlite3"
./src/sqliteInt.h:840: error: syntax error before '*' token
./src/sqliteInt.h:840: warning: data definition has no type or storage
class
./src/sqliteInt.h:874: error: syntax error before "nDeferredCons"
./src/sqliteInt.h:874: warning: data definition has no type or storage
class
./src/sqliteInt.h:956: error: syntax error before '*' token
./src/sqliteInt.h:957: error: syntax error before '*' token
./src/sqliteInt.h:958: error: syntax error before '*' token
./src/sqliteInt.h:1019: error: syntax error before "i64"
./src/sqliteInt.h:1019: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1021: error: syntax error before '}' token
./src/sqliteInt.h:1038: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1038: error: syntax error before '*' token
./src/sqliteInt.h:1042: error: syntax error before '}' token
./src/sqliteInt.h:1185: error: syntax error before "sqlite3"
./src/sqliteInt.h:1185: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1187: error: syntax error before '*' token
./src/sqliteInt.h:1187: error: conflicting types for 'pVtab'
./src/vdbe.h:60: error: previous declaration of 'pVtab' was here
./src/sqliteInt.h:1187: warning: data definition has no type or
storage class
./src/sqliteInt.h:1189: error: conflicting types for 'pNext'
./src/sqliteInt.h:1020: error: previous declaration of 'pNext' was
here
./src/sqliteInt.h:1190: error: syntax error before '}' token
./src/sqliteInt.h:1223: error: syntax error before "sqlite3"
./src/sqliteInt.h:1223: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1224: error: conflicting types for 'zName'
./src/sqliteInt.h:1039: error: previous declaration of 'zName' was
here
./src/sqliteInt.h:1231: error: conflicting types for 'nRef'
./src/sqliteInt.h:1188: error: previous declaration of 'nRef' was here
./src/sqliteInt.h:1250: error: syntax error before '}' token
./src/sqliteInt.h:1359: error: syntax error before "sqlite3"
./src/sqliteInt.h:1359: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1364: error: syntax error before '}' token
./src/sqliteInt.h:1384: error: syntax error before "i64"
./src/sqliteInt.h:1384: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1386: error: syntax error before '}' token
./src/sqliteInt.h:1761: error: syntax error before "Bitmask"
./src/sqliteInt.h:1761: warning: data definition has no type or
storage class
./src/sqliteInt.h:1799: error: syntax error before "Bitmask"
./src/sqliteInt.h:1799: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1799: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1802: error: syntax error before '}' token
./src/sqliteInt.h:1802: warning: data definition has no type or
storage class
./src/sqliteInt.h:1803: error: syntax error before '}' token
./src/sqliteInt.h:1837: error: syntax error before
"sqlite3_index_info"
./src/sqliteInt.h:1837: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1837: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1838: warning: data definition has no type or
storage class
./src/sqliteInt.h:1839: error: syntax error before '}' token
./src/sqliteInt.h:1855: error: field `plan' has incomplete type
./src/sqliteInt.h:1882: error: syntax error before
"sqlite3_index_info"
./src/sqliteInt.h:1882: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1915: error: field `a' has incomplete type
./src/sqliteInt.h:2102: error: syntax error before "sqlite3"
./src/sqliteInt.h:2102: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2185: error: syntax error before '}' token
./src/sqliteInt.h:2320: error: syntax error before "sqlite3"
./src/sqliteInt.h:2320: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2329: error: syntax error before '}' token
./src/sqliteInt.h:2336: error: syntax error before "sqlite3"
./src/sqliteInt.h:2336: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2340: error: syntax error before '}' token
./src/sqliteInt.h:2340: warning: data definition has no type or
storage class
./src/sqliteInt.h:2354: error: syntax error before
"sqlite3_mem_methods"
./src/sqliteInt.h:2354: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2355: error: conflicting types for 'mutex'
./src/sqliteInt.h:814: error: previous declaration of 'mutex' was here
./src/sqliteInt.h:2355: warning: data definition has no type or
storage class
./src/sqliteInt.h:2356: error: syntax error before "pcache"
./src/sqliteInt.h:2356: warning: data definition has no type or
storage class
./src/sqliteInt.h:2375: error: syntax error before '*' token
./src/sqliteInt.h:2375: warning: data definition has no type or
storage class
./src/sqliteInt.h:2377: error: syntax error before '}' token
./src/sqliteInt.h:2474: error: syntax error before '*' token
./src/sqliteInt.h:2475: error: syntax error before '*' token
./src/sqliteInt.h:2476: error: syntax error before '*' token
./src/sqliteInt.h:2477: error: syntax error before '*' token
./src/sqliteInt.h:2479: error: syntax error before '*' token
./src/sqliteInt.h:2480: error: syntax error before '*' token
./src/sqliteInt.h:2481: error: syntax error before '*' token
./src/sqliteInt.h:2483: error: syntax error before '*' token
./src/sqliteInt.h:2490: error: syntax error before "sqlite3_int64"
./src/sqliteInt.h:2490: error: syntax error before "sqlite3_int64"
./src/sqliteInt.h:2519: error: syntax error before '*' token
./src/sqliteInt.h:2519: warning: data definition has no type or
storage class
./src/sqliteInt.h:2520: error: syntax error before '*' token
./src/sqliteInt.h:2520: warning: data definition has no type or
storage class
./src/sqliteInt.h:2535: error: syntax error before '*' token
./src/sqliteInt.h:2536: error: syntax error before '*' token
./src/sqliteInt.h:2537: error: syntax error before '*' token
./src/sqliteInt.h:2544: error: syntax error before "sqlite3"
./src/sqliteInt.h:2555: error: syntax error before '*' token
./src/sqliteInt.h:2556: error: syntax error before '*' token
./src/sqliteInt.h:2557: error: syntax error before '*' token
./src/sqliteInt.h:2559: error: syntax error before '*' token
./src/sqliteInt.h:2562: error: syntax error before '*' token
./src/sqliteInt.h:2566: error: syntax error before '*' token
./src/sqliteInt.h:2567: error: syntax error before '*' token
./src/sqliteInt.h:2570: error: syntax error before '*' token
./src/sqliteInt.h:2572: error: syntax error before '*' token
./src/sqliteInt.h:2593: error: syntax error before '*' token
./src/sqliteInt.h:2595: error: syntax error before "i64"
./src/sqliteInt.h:2596: error: syntax error before "i64"
./src/sqliteInt.h:2597: error: syntax error before "i64"
./src/sqliteInt.h:2617: error: syntax error before '*' token
./src/sqliteInt.h:2618: error: syntax error before '*' token
./src/sqliteInt.h:2620: error: syntax error before '*' token
./src/sqliteInt.h:2621: error: syntax error before '*' token
./src/sqliteInt.h:2628: error: syntax error before '*' token
./src/sqliteInt.h:2629: error: syntax error before '*' token
./src/sqliteInt.h:2636: error: syntax error before '*' token
./src/sqliteInt.h:2665: error: syntax error before '*' token
./src/sqliteInt.h:2667: error: syntax error before '*' token
./src/sqliteInt.h:2668: error: syntax error before '*' token
./src/sqliteInt.h:2669: error: syntax error before '*' token
./src/sqliteInt.h:2671: error: syntax error before "sqlite3"
./src/sqliteInt.h:2672: error: syntax error before '*' token
./src/sqliteInt.h:2680: error: syntax error before '*' token
./src/sqliteInt.h:2686: error: syntax error before '*' token
./src/sqliteInt.h:2706: error: syntax error before '*' token
./src/sqliteInt.h:2707: error: syntax error before '*' token
./src/sqliteInt.h:2708: error: syntax error before '*' token
./src/sqliteInt.h:2709: error: syntax error before '*' token
./src/sqliteInt.h:2710: error: syntax error before '*' token
./src/sqliteInt.h:2712: error: syntax error before '*' token
./src/sqliteInt.h:2713: error: syntax error before '*' token
./src/sqliteInt.h:2723: error: syntax error before '*' token
./src/sqliteInt.h:2724: error: syntax error before '*' token
./src/sqliteInt.h:2743: error: syntax error before '*' token
./src/sqliteInt.h:2744: error: syntax error before '*' token
./src/sqliteInt.h:2745: error: syntax error before '*' token
./src/sqliteInt.h:2747: error: syntax error before '*' token
./src/sqliteInt.h:2748: error: syntax error before '*' token
./src/sqliteInt.h:2749: error: syntax error before '*' token
./src/sqliteInt.h:2750: error: syntax error before '*' token
./src/sqliteInt.h:2782: error: syntax error before '*' token
./src/sqliteInt.h:2804: error: syntax error before "u64"
./src/sqliteInt.h:2806: error: syntax error before "u64"
./src/sqliteInt.h:2808: error: syntax error before "v"
./src/sqliteInt.h:2838: error: syntax error before "i64"
./src/sqliteInt.h:2839: error: syntax error before '*' token
./src/sqliteInt.h:2840: error: syntax error before '*' token
./src/sqliteInt.h:2844: error: syntax error before '*' token
./src/sqliteInt.h:2850: error: syntax error before '*' token
./src/sqliteInt.h:2852: error: syntax error before '*' token
./src/sqliteInt.h:2853: error: syntax error before '*' token
./src/sqliteInt.h:2854: error: syntax error before '*' token
./src/sqliteInt.h:2855: error: syntax error before ')' token
./src/sqliteInt.h:2856: error: syntax error before '*' token
./src/sqliteInt.h:2857: error: syntax error before '*' token
./src/sqliteInt.h:2857: error: syntax error before '*' token
./src/sqliteInt.h:2857: warning: data definition has no type or
storage class
./src/sqliteInt.h:2858: error: syntax error before '*' token
./src/sqliteInt.h:2862: error: syntax error before '*' token
./src/sqliteInt.h:2863: error: syntax error before '*' token
./src/sqliteInt.h:2874: error: syntax error before '*' token
./src/sqliteInt.h:2878: error: syntax error before '*' token
./src/sqliteInt.h:2887: error: syntax error before '*' token
./src/sqliteInt.h:2891: error: syntax error before '*' token
./src/sqliteInt.h:2892: error: syntax error before '*' token
./src/sqliteInt.h:2893: error: syntax error before '*' token
./src/sqliteInt.h:2896: error: syntax error before '*' token
./src/sqliteInt.h:2897: error: syntax error before '*' token
./src/sqliteInt.h:2900: error: syntax error before '*' token
./src/sqliteInt.h:2901: error: syntax error before '*' token
./src/sqliteInt.h:2903: error: syntax error before '*' token
./src/sqliteInt.h:2904: error: syntax error before '*' token
./src/sqliteInt.h:2904: error: `sqlite3CreateFunc' declared as
function returnin
g a function
./src/sqliteInt.h:2906: error: syntax error before '*' token
./src/sqliteInt.h:2914: error: syntax error before '*' token
./src/sqliteInt.h:2916: error: syntax error before '*' token
./src/sqliteInt.h:2917: error: syntax error before '*' token
./src/sqliteInt.h:2929: error: syntax error before '*' token
./src/sqliteInt.h:2957: error: syntax error before '*' token
./src/sqliteInt.h:2958: error: syntax error before '*' token
./src/sqliteInt.h:2959: error: syntax error before '*' token
./src/sqliteInt.h:2962: error: syntax error before '*' token
./src/sqliteInt.h:2970: error: syntax error before '*' token
./src/sqliteInt.h:2972: error: syntax error before '*' token
./src/sqliteInt.h:2973: error: syntax error before '*' token
./src/sqliteInt.h:2974: error: syntax error before '*' token
./src/sqliteInt.h:2975: error: syntax error before '*' token
./src/sqliteInt.h:2977: error: syntax error before '*' token
./src/sqliteInt.h:2981: error: syntax error before '*' token
./src/sqliteInt.h:2982: error: syntax error before '*' token
./src/sqliteInt.h:3044: error: syntax error before '*' token
./src/sqliteInt.h:3046: error: syntax error before '*' token
./src/alter.c:38: error: syntax error before '*' token
./src/alter.c: In function `renameTableFunc':
./src/alter.c:42: error: `argv' undeclared (first use in this
function)
./src/alter.c:42: error: (Each undeclared identifier is reported only
once
./src/alter.c:42: error: for each function it appears in.)
./src/alter.c:42: warning: initialization makes pointer from integer
without a c
ast
./src/alter.c:43: warning: initialization makes pointer from integer
without a c
ast
./src/alter.c:51: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:51: error: `db' undeclared (first use in this function)
./src/alter.c:51: error: `context' undeclared (first use in this
function)
./src/alter.c:53: error: `NotUsed' undeclared (first use in this
function)
./src/alter.c:82: error: `sqlite3_destructor_type' undeclared (first
use in this
function)
./src/alter.c:82: error: syntax error before "sqlite3DbFree"
./src/alter.c: At top level:
./src/alter.c:103: error: syntax error before '*' token
./src/alter.c: In function `renameParentFunc':
./src/alter.c:107: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:107: error: `db' undeclared (first use in this function)
./src/alter.c:107: error: `context' undeclared (first use in this
function)
./src/alter.c:110: error: `argv' undeclared (first use in this
function)
./src/alter.c:110: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:111: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:112: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:118: error: `NotUsed' undeclared (first use in this
function)
./src/alter.c:144: error: `sqlite3_destructor_type' undeclared (first
use in thi
s function)
./src/alter.c:144: error: syntax error before "sqlite3DbFree"
./src/alter.c: At top level:
./src/alter.c:158: error: syntax error before '*' token
./src/alter.c: In function `renameTriggerFunc':
./src/alter.c:162: error: `argv' undeclared (first use in this
function)
./src/alter.c:162: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:163: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:171: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:171: error: `db' undeclared (first use in this function)
./src/alter.c:171: error: `context' undeclared (first use in this
function)
./src/alter.c:173: error: `NotUsed' undeclared (first use in this
function)
./src/alter.c:221: error: `sqlite3_destructor_type' undeclared (first
use in thi
s function)
./src/alter.c:221: error: syntax error before "sqlite3DbFree"
./src/alter.c: At top level:
./src/alter.c:229: error: syntax error before '*' token
./src/alter.c: In function `sqlite3AlterFunctions':
./src/alter.c:230: error: `db' undeclared (first use in this function)
./src/alter.c:230: error: `SQLITE_UTF8' undeclared (first use in this
function)
./src/alter.c: At top level:
./src/alter.c:258: error: syntax error before '*' token
./src/alter.c: In function `whereOrName':
./src/alter.c:260: error: `zWhere' undeclared (first use in this
function)
./src/alter.c:261: error: `db' undeclared (first use in this function)
./src/alter.c:261: error: `zConstant' undeclared (first use in this
function)
./src/alter.c: In function `whereForeignKeys':
./src/alter.c:280: error: dereferencing pointer to incomplete type
./src/alter.c:280: error: dereferencing pointer to incomplete type
./src/alter.c: In function `whereTempTriggers':
./src/alter.c:295: error: dereferencing pointer to incomplete type
./src/alter.c:302: error: dereferencing pointer to incomplete type
./src/alter.c:303: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:303: error: `db' undeclared (first use in this function)
./src/alter.c:303: error: dereferencing pointer to incomplete type
./src/alter.c: In function `reloadTableSchema':
./src/alter.c:332: error: dereferencing pointer to incomplete type
./src/alter.c:332: error: dereferencing pointer to incomplete type
./src/alter.c:338: error: dereferencing pointer to incomplete type
./src/alter.c:345: error: dereferencing pointer to incomplete type
./src/alter.c:348: error: dereferencing pointer to incomplete type
./src/alter.c: In function `sqlite3AlterRenameTable':
./src/alter.c:375: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:375: error: `db' undeclared (first use in this function)
./src/alter.c:375: error: dereferencing pointer to incomplete type
./src/alter.c:388: error: dereferencing pointer to incomplete type
./src/alter.c:388: error: dereferencing pointer to incomplete type
./src/alter.c:390: error: dereferencing pointer to incomplete type
./src/alter.c:390: error: dereferencing pointer to incomplete type
./src/alter.c:409: error: dereferencing pointer to incomplete type
./src/alter.c:410: error: dereferencing pointer to incomplete type
./src/alter.c:412: error: dereferencing pointer to incomplete type
./src/alter.c:415: error: `SQLITE_OK' undeclared (first use in this
function)
./src/alter.c:420: error: dereferencing pointer to incomplete type
./src/alter.c:421: error: dereferencing pointer to incomplete type
./src/alter.c:428: error: `SQLITE_ALTER_TABLE' undeclared (first use
in this fun
ction)
./src/alter.c:428: error: dereferencing pointer to incomplete type
./src/alter.c:437: error: dereferencing pointer to incomplete type
./src/alter.c:439: error: dereferencing pointer to incomplete type
./src/alter.c:464: error: dereferencing pointer to incomplete type
./src/alter.c:472: error: dereferencing pointer to incomplete type
./src/alter.c:522: error: dereferencing pointer to incomplete type
./src/alter.c:547: error: dereferencing pointer to incomplete type
./src/alter.c: In function `sqlite3AlterFinishAddColumn':
./src/alter.c:604: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:604: error: `db' undeclared (first use in this function)
./src/alter.c:606: error: dereferencing pointer to incomplete type
./src/alter.c:607: error: dereferencing pointer to incomplete type
./src/alter.c:608: error: dereferencing pointer to incomplete type
./src/alter.c:612: error: dereferencing pointer to incomplete type
./src/alter.c:614: error: dereferencing pointer to incomplete type
./src/alter.c:615: error: dereferencing pointer to incomplete type
./src/alter.c:615: error: dereferencing pointer to incomplete type
./src/alter.c:622: error: `SQLITE_ALTER_TABLE' undeclared (first use
in this fun
ction)
./src/alter.c:622: error: dereferencing pointer to incomplete type
./src/alter.c:643: error: dereferencing pointer to incomplete type
./src/alter.c:647: error: dereferencing pointer to incomplete type
./src/alter.c:662: error: `sqlite3_value' undeclared (first use in
this function
)
./src/alter.c:662: error: `pVal' undeclared (first use in this
function)
./src/alter.c:663: error: `SQLITE_UTF8' undeclared (first use in this
function)
./src/alter.c:685: error: dereferencing pointer to incomplete type
./src/alter.c:685: error: dereferencing pointer to incomplete type
./src/alter.c:698: error: dereferencing pointer to incomplete type
./src/alter.c: In function `sqlite3AlterBeginAddColumn':
./src/alter.c:723: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:723: error: `db' undeclared (first use in this function)
./src/alter.c:723: error: dereferencing pointer to incomplete type
./src/alter.c:729: error: dereferencing pointer to incomplete type
./src/alter.c:729: error: dereferencing pointer to incomplete type
./src/alter.c:733: error: dereferencing pointer to incomplete type
./src/alter.c:740: error: dereferencing pointer to incomplete type
./src/alter.c:746: error: dereferencing pointer to incomplete type
./src/alter.c:755: error: invalid application of `sizeof' to
incomplete type `./
src/sqliteInt.h'
./src/alter.c:757: error: dereferencing pointer to incomplete type
./src/alter.c:758: error: dereferencing pointer to incomplete type
./src/alter.c:759: error: dereferencing pointer to incomplete type
./src/alter.c:759: error: dereferencing pointer to incomplete type
./src/alter.c:760: error: dereferencing pointer to incomplete type
./src/alter.c:760: error: dereferencing pointer to incomplete type
./src/alter.c:762: error: dereferencing pointer to incomplete type
./src/alter.c:764: error: dereferencing pointer to incomplete type
./src/alter.c:765: error: dereferencing pointer to incomplete type
./src/alter.c:765: error: dereferencing pointer to incomplete type
./src/alter.c:766: error: dereferencing pointer to incomplete type
./src/alter.c:766: error: dereferencing pointer to incomplete type
./src/alter.c:770: error: dereferencing pointer to incomplete type
./src/alter.c:770: error: dereferencing pointer to incomplete type
./src/alter.c:770: error: dereferencing pointer to incomplete type
./src/alter.c:771: error: dereferencing pointer to incomplete type
./src/alter.c:772: error: dereferencing pointer to incomplete type
./src/alter.c:779: error: dereferencing pointer to incomplete type
./src/alter.c:780: error: dereferencing pointer to incomplete type
./src/alter.c:780: error: dereferencing pointer to incomplete type
./src/alter.c:781: error: dereferencing pointer to incomplete type
./src/alter.c: At top level:
./src/sqliteInt.h:815: error: storage size of `aLimit' isn't known
make: *** [alter.lo] Error 1

Can't you help me? What's wrong now?

Stephen Lombardo

unread,
Mar 25, 2010, 12:40:06 PM3/25/10
to sqlc...@googlegroups.com
Ilya,

The problem is that the first time you ran make build of sqlite3.h failed because of the tcl dependency. the SQlite makefile will not rebuild sqlite3.h if it is present, but the file is probably empty. Try:

rm sqlite3.h

Then run make again.

Cheers,
Stephen

illuk

unread,
Mar 26, 2010, 6:03:33 AM3/26/10
to SQLCipher Users
Hi, Stephen and thank you very much for a great help! It compilled now
so i have exe & dll files.
It was a problem when 'make dll' but this helped:

./configure --disable-tcl --disable-amalgamation CFLAGS="-

DSQLITE_HAS_CODE -I/c/OpenSSL/include -leay32 -L/c/OpenSSL/lib"
make
make dll

It's working now but i can't encrypt anything. Here is what i've done:

C:\sqlite>sqlite3 new.db
SQLite version 3.6.21
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> pragma key = '1234567';
sqlite> create table a(b int);
sqlite> insert into a values(1);
sqlite> insert into a values(2);
sqlite> insert into a values(3);
sqlite> .exit

C:\sqlite>sqlite3 new.db
SQLite version 3.6.21
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from a;
1
2
3


So no key inputed but my data is still acessable... What have i done
wrong?

> ...
>
> read more »

Stephen Lombardo

unread,
Mar 26, 2010, 9:12:25 AM3/26/10
to sqlc...@googlegroups.com
Hi Ilya,

It looks like the problem may be with your CFLAGS variable, since you have set -DSQLITE_HAS_CODE instead of -DSQLITE_HAS_CODEC. If SQLITE_HAS_CODEC isn't defined at build time the system complies as the standard sqlite and PRAGMA key will have no effect. Try the following and see if it works.

./configure --disable-tcl --disable-amalgamation CFLAGS="-DSQLITE_HAS_CODEC -I/c/OpenSSL/include -leay32 -L/c/OpenSSL/lib"
make
make dll

Cheers,
Stephen

illuk

unread,
Mar 26, 2010, 12:49:05 PM3/26/10
to SQLCipher Users
All is great!!! And THANK YOU VERY VERY MUCH!!! Without your help my
project will be failed!
I want to do something good for you. For example, would it be usefull
for you if i write a gide of "how to compile sqlcipher" for windows?

Billy Gray

unread,
Mar 26, 2010, 1:35:39 PM3/26/10
to sqlc...@googlegroups.com
Hi Ilya, 

That's great news!

If you have the time to put together such a how-to guide for compiling with MinGW/MSYS, I would gladly add it to the github wiki for SQLCipher.

Regards,
Billy

To unsubscribe from this group, send email to sqlcipher+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.



--
Billy Gray
http://zetetic.net

Yogi

unread,
Apr 23, 2010, 1:40:35 AM4/23/10
to SQLCipher Users
Hi all.

I can not make SQL Chiper, gives these errors:
...
./src/sqliteInt.h:1837: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1837: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1838: warning: data definition has no type or
storage class
./src/sqliteInt.h:1839: error: syntax error before '}' token
./src/sqliteInt.h:1855: error: field `plan' has incomplete type
./src/sqliteInt.h:1882: error: syntax error before
"sqlite3_index_info"
./src/sqliteInt.h:1882: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:1915: error: field `a' has incomplete type
./src/sqliteInt.h:2102: error: syntax error before "sqlite3"
./src/sqliteInt.h:2102: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2185: error: syntax error before '}' token
./src/sqliteInt.h:2320: error: syntax error before "sqlite3"
./src/sqliteInt.h:2320: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2329: error: syntax error before '}' token
./src/sqliteInt.h:2336: error: syntax error before "sqlite3"
./src/sqliteInt.h:2336: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2340: error: syntax error before '}' token
./src/sqliteInt.h:2340: warning: data definition has no type or
storage class
./src/sqliteInt.h:2354: error: syntax error before
"sqlite3_mem_methods"
./src/sqliteInt.h:2354: warning: no semicolon at end of struct or
union
./src/sqliteInt.h:2355: error: conflicting types for 'mutex'
./src/sqliteInt.h:814: error: previous declaration of 'mutex' was here
./src/sqliteInt.h:2355: warning: data definition has no type or
storage class
./src/sqliteInt.h:2356: error: syntax error before "pcache"
./src/sqliteInt.h:2356: warning: data definition has no type or
storage class
./src/sqliteInt.h:2375: error: syntax error before '*' token
./src/sqliteInt.h:2375: warning: data definition has no type or
storage class
./src/sqliteInt.h:2377: error: syntax error before '}' token
./src/sqliteInt.h:2474: error: syntax error before '*' token
./src/sqliteInt.h:2475: error: syntax error before '*' token
./src/sqliteInt.h:2476: error: syntax error before '*' token
./src/sqliteInt.h:2477: error: syntax error before '*' token
./src/sqliteInt.h:2479: error: syntax error before '*' token
./src/sqliteInt.h:2480: error: syntax error before '*' token
./src/sqliteInt.h:2481: error: syntax error before '*' token
./src/sqliteInt.h:2483: error: syntax error before '*' token
./src/sqliteInt.h:2490: error: syntax error before "sqlite3_int64"
./src/sqliteInt.h:2490: error: syntax error before "sqlite3_int64"
./src/sqliteInt.h:2519: error: syntax error before '*' token
./src/sqliteInt.h:2519: warning: data definition has no type or
storage class
./src/sqliteInt.h:2520: error: syntax error before '*' token
./src/sqliteInt.h:2520: warning: data definition has no type or
storage class
./src/sqliteInt.h:2535: error: syntax error before '*' token
./src/sqliteInt.h:2536: error: syntax error before '*' token
./src/sqliteInt.h:2537: error: syntax error before '*' token
./src/sqliteInt.h:2544: error: syntax error before "sqlite3"
./src/sqliteInt.h:2555: error: syntax error before '*' token
./src/sqliteInt.h:2556: error: syntax error before '*' token
./src/sqliteInt.h:2557: error: syntax error before '*' token
./src/sqliteInt.h:2559: error: syntax error before '*' token
./src/sqliteInt.h:2562: error: syntax error before '*' token
./src/sqliteInt.h:2566: error: syntax error before '*' token
./src/sqliteInt.h:2567: error: syntax error before '*' token
./src/sqliteInt.h:2570: error: syntax error before '*' token
./src/sqliteInt.h:2572: error: syntax error before '*' token
./src/sqliteInt.h:2593: error: syntax error before '*' token
./src/sqliteInt.h:2595: error: syntax error before "i64"
./src/sqliteInt.h:2596: error: syntax error before "i64"
./src/sqliteInt.h:2597: error: syntax error before "i64"
./src/sqliteInt.h:2617: error: syntax error before '*' token
./src/sqliteInt.h:2618: error: syntax error before '*' token
./src/sqliteInt.h:2620: error: syntax error before '*' token
./src/sqliteInt.h:2621: error: syntax error before '*' token
./src/sqliteInt.h:2628: error: syntax error before '*' token
./src/sqliteInt.h:2629: error: syntax error before '*' token
./src/sqliteInt.h:2636: error: syntax error before '*' token
./src/sqliteInt.h:2665: error: syntax error before '*' token
./src/sqliteInt.h:2667: error: syntax error before '*' token
./src/sqliteInt.h:2668: error: syntax error before '*' token
./src/sqliteInt.h:2669: error: syntax error before '*' token
./src/sqliteInt.h:2671: error: syntax error before "sqlite3"
./src/sqliteInt.h:2672: error: syntax error before '*' token
./src/sqliteInt.h:2680: error: syntax error before '*' token
./src/sqliteInt.h:2686: error: syntax error before '*' token
./src/sqliteInt.h:2706: error: syntax error before '*' token
./src/sqliteInt.h:2707: error: syntax error before '*' token
./src/sqliteInt.h:2708: error: syntax error before '*' token
./src/sqliteInt.h:2709: error: syntax error before '*' token
./src/sqliteInt.h:2710: error: syntax error before '*' token
./src/sqliteInt.h:2712: error: syntax error before '*' token
./src/sqliteInt.h:2713: error: syntax error before '*' token
./src/sqliteInt.h:2723: error: syntax error before '*' token
./src/sqliteInt.h:2724: error: syntax error before '*' token
./src/sqliteInt.h:2743: error: syntax error before '*' token
./src/sqliteInt.h:2744: error: syntax error before '*' token
./src/sqliteInt.h:2745: error: syntax error before '*' token
./src/sqliteInt.h:2747: error: syntax error before '*' token
./src/sqliteInt.h:2748: error: syntax error before '*' token
./src/sqliteInt.h:2749: error: syntax error before '*' token
./src/sqliteInt.h:2750: error: syntax error before '*' token
./src/sqliteInt.h:2782: error: syntax error before '*' token
./src/sqliteInt.h:2804: error: syntax error before "u64"
./src/sqliteInt.h:2806: error: syntax error before "u64"
./src/sqliteInt.h:2808: error: syntax error before "v"
./src/sqliteInt.h:2838: error: syntax error before "i64"
./src/sqliteInt.h:2839: error: syntax error before '*' token
./src/sqliteInt.h:2840: error: syntax error before '*' token
./src/sqliteInt.h:2844: error: syntax error before '*' token
./src/sqliteInt.h:2850: error: syntax error before '*' token
./src/sqliteInt.h:2852: error: syntax error before '*' token
./src/sqliteInt.h:2853: error: syntax error before '*' token
./src/sqliteInt.h:2854: error: syntax error before '*' token
./src/sqliteInt.h:2855: error: syntax error before ')' token
./src/sqliteInt.h:2856: error: syntax error before '*' token
./src/sqliteInt.h:2857: error: syntax error before '*' token
./src/sqliteInt.h:2857: error: syntax error before '*' token
./src/sqliteInt.h:2857: warning: data definition has no type or
storage class
./src/sqliteInt.h:2858: error: syntax error before '*' token
./src/sqliteInt.h:2862: error: syntax error before '*' token
./src/sqliteInt.h:2863: error: syntax error before '*' token
./src/sqliteInt.h:2874: error: syntax error before '*' token
./src/sqliteInt.h:2878: error: syntax error before '*' token
./src/sqliteInt.h:2887: error: syntax error before '*' token
./src/sqliteInt.h:2891: error: syntax error before '*' token
./src/sqliteInt.h:2892: error: syntax error before '*' token
./src/sqliteInt.h:2893: error: syntax error before '*' token
./src/sqliteInt.h:2896: error: syntax error before '*' token
./src/sqliteInt.h:2897: error: syntax error before '*' token
./src/sqliteInt.h:2900: error: syntax error before '*' token
./src/sqliteInt.h:2901: error: syntax error before '*' token
./src/sqliteInt.h:2903: error: syntax error before '*' token
./src/sqliteInt.h:2904: error: syntax error before '*' token
./src/sqliteInt.h:2904: error: `sqlite3CreateFunc' declared as
function returnin
g a function
./src/sqliteInt.h:2906: error: syntax error before '*' token
./src/sqliteInt.h:2914: error: syntax error before '*' token
./src/sqliteInt.h:2916: error: syntax error before '*' token
./src/sqliteInt.h:2917: error: syntax error before '*' token
./src/sqliteInt.h:2929: error: syntax error before '*' token
./src/sqliteInt.h:2957: error: syntax error before '*' token
./src/sqliteInt.h:2958: error: syntax error before '*' token
./src/sqliteInt.h:2959: error: syntax error before '*' token
./src/sqliteInt.h:2962: error: syntax error before '*' token
./src/sqliteInt.h:2970: error: syntax error before '*' token
./src/sqliteInt.h:2972: error: syntax error before '*' token
./src/sqliteInt.h:2973: error: syntax error before '*' token
./src/sqliteInt.h:2974: error: syntax error before '*' token
./src/sqliteInt.h:2975: error: syntax error before '*' token
./src/sqliteInt.h:2977: error: syntax error before '*' token
./src/sqliteInt.h:2981: error: syntax error before '*' token
./src/sqliteInt.h:2982: error: syntax error before '*' token
./src/sqliteInt.h:3044: error: syntax error before '*' token
./src/sqliteInt.h:3046: error: syntax error before '*' token
./src/alter.c:38: error: syntax error before '*' token
./src/alter.c: In function `renameTableFunc':
./src/alter.c:42: error: `argv' undeclared (first use in this
function)
./src/alter.c:42: error: (Each undeclared identifier is reported only
once
./src/alter.c:42: error: for each function it appears in.)
./src/alter.c:42: warning: initialization makes pointer from integer
without a c
ast
./src/alter.c:43: warning: initialization makes pointer from integer
without a c
ast
./src/alter.c:51: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:51: error: `db' undeclared (first use in this function)
./src/alter.c:51: error: `context' undeclared (first use in this
function)
./src/alter.c:53: error: `NotUsed' undeclared (first use in this
function)
./src/alter.c:82: error: `sqlite3_destructor_type' undeclared (first
use in this
function)
./src/alter.c:82: error: syntax error before "sqlite3DbFree"
./src/alter.c: At top level:
./src/alter.c:103: error: syntax error before '*' token
./src/alter.c: In function `renameParentFunc':
./src/alter.c:107: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:107: error: `db' undeclared (first use in this function)
./src/alter.c:107: error: `context' undeclared (first use in this
function)
./src/alter.c:110: error: `argv' undeclared (first use in this
function)
./src/alter.c:110: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:111: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:112: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:118: error: `NotUsed' undeclared (first use in this
function)
./src/alter.c:144: error: `sqlite3_destructor_type' undeclared (first
use in thi
s function)
./src/alter.c:144: error: syntax error before "sqlite3DbFree"
./src/alter.c: At top level:
./src/alter.c:158: error: syntax error before '*' token
./src/alter.c: In function `renameTriggerFunc':
./src/alter.c:162: error: `argv' undeclared (first use in this
function)
./src/alter.c:162: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:163: warning: initialization makes pointer from integer
without a
cast
./src/alter.c:171: error: `sqlite3' undeclared (first use in this
function)
./src/alter.c:171: error: `db' undeclared (first use in this function)
./src/alter.c:171: error: `context' undeclared (first use in this
function)
./src/alter.c:173: error: `NotUsed' undeclared (first use in this
function)
./src/alter.c:221: error: `sqlite3_destructor_type' undeclared (first
use in thi
s function)
./src/alter.c:221: error: syntax error before "sqlite3DbFree"
./src/alter.c: At top level:
./src/alter.c:229: error: syntax error before '*' token
Yogi@WINXPSP3 /c/dev/src/sjlombardo-sqlcipher-e533187
$
Here is my. / Configure line:
./configure --disable-tcl --disable-amalgamation CFLAGS="-
DSQLITE_HAS_CODEС -I/c/dev/src/openssl-1.0.0/include/openssl -leay32 -
L/c/OpenSSL/"

What's wrong?

Thanks for the answers


--
Subscription settings: http://groups.google.com/group/sqlcipher/subscribe?hl=en

Игорь Богомолов

unread,
Apr 23, 2010, 5:04:03 PM4/23/10
to sqlc...@googlegroups.com
Hi Yogi 

install Win32 OpenSSL v0.9.8m
install TclTk
rename MINGWPATH/bin/tclsh84.exe  to  tclsh.exe

cd sqlcipher
$ ./configure --disable-tcl --disable-amalgamation
CFLAGS
="-DSQLITE_HAS_CODEC -I../OpenSSL/include /c/Windows/System32/libeay32.dll"
$ make
$ make dll
$ make install

Luca

unread,
Aug 12, 2012, 7:03:22 AM8/12/12
to sqlc...@googlegroups.com
In case anyone else needs to compile SQLCipher under Windows I wrote some notes here. I used cygwin and mingw. Hope it might be of help.

Luca

hari gaire

unread,
Nov 20, 2012, 11:40:01 PM11/20/12
to sqlc...@googlegroups.com, sjlom...@zetetic.net
Hi stephan,

when i try to run:

./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -I/path/to/openssl/include" LDFLAGS="-leay32"

I get following error in config.log

configure:2578: checking for C compiler default output file name
configure:2600: gcc -DSQLITE_HAS_CODEC -I/c/OpenSSL-Win64/include  -leay32 conftest.c  >&5
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -leay32
collect2.exe: error: ld returned 1 exit status

what may be the reason ??


Thanks for the answers 


On Thursday, December 24, 2009 9:15:24 AM UTC+5:45, Stephen Lombardo wrote:
Hi Will,

It's good to hear from you. We included a whole bunch of fixes in 1.1.0 that allow SQLCipher to be used on windows. With the latest sources I've compiled and run it successfully using both MInGW and Visual Studio.

The trickier part is getting OpenSSL going. I was not able to get a simple MinGW build of OpenSSL working due to various issues in the make system cased by MinGW's lack of symlinks. However, building OpenSSL is fairly easy if you have Visual Studio and ActiveState Perl on your system. Just run the following from the visual studio command line (ensure perl is in the path)


perl Configure VC-WIN32 --prefix=build
ms\do_masm.bat
nmake -f ms\nt.mak
nmake -f ms\ntdll.mak
nmake -f ms\nt.mak install

That will drop libeay32.dll and libeay32.lib file in build/bin. From there you can copy libeay32.dll over to your sqlcipher directory and run the sqlcipher build under msys. It's pretty standard, just disable tcl since it won't be present under a default install.


./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -I/path/to/openssl/include" LDFLAGS="-leay32"
make
make dll

That will create a working sqlite3 binary and sqlite3.dll.

I've also been successful in compiling the amalgamated sqlite3.c in a Visual Studio project and statically linking it to libeay32.lib to remove the runtime dll dependencies.

Cheers,
Stephen

==
Stephen Lombardo
http://www.zetetic.net

Luca

unread,
Nov 21, 2012, 4:40:48 AM11/21/12
to sqlc...@googlegroups.com
Read here. You're missing the OpenSSL it seems.

Luca

thinkthin...@gmail.com

unread,
Sep 3, 2013, 4:14:01 AM9/3/13
to sqlc...@googlegroups.com
Hi Illuk!
Recently,I am studying sqlcipher. I have done a lot of work on compling sqlcipher under windows but I failed! I am a greener, did you write a guide of "how to compile
sqlcipher for windows"? I need it very much. I have suffered a lot. Please help me !!!!! If you can give me the latest version dll of sqlcipher ,It will be great!!!!!!!!!!
Thank you !
在 2010年3月27日星期六UTC+8上午12时49分05秒,illuk写道:

Nick Parker

unread,
Sep 3, 2013, 11:12:45 AM9/3/13
to sqlc...@googlegroups.com, thinkthin...@gmail.com
Hi,

If you are receiving an error during compilation, please post the error
message as that would be needed to help.
> --
>
> ---
> 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.

--
Nick Parker

sife sife

unread,
Sep 24, 2013, 2:52:56 AM9/24/13
to sqlc...@googlegroups.com
Hello,
Would you post the compilation error, and how did you configure you
environment before compiling sqlcipher?

Rodrigo Rodrigues

unread,
Jan 29, 2014, 3:08:44 PM1/29/14
to sqlc...@googlegroups.com
Hello all,


I got sqlcipher compiled for Windows according the messages at this topic.
The only problem I have is the sqlite3.dll dependence on llibgcc_s_dw2-1.dll. Is it possible to make a static link to libgcc_s_dw2-1 library so the sqlite3.dll has not dependence on libgcc dll?

My configure parameters are these: ./configure --disable-tcl --with-crypto-lib=none --disable-amalgamation CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl/include/ -L/c/openssl/lib"  LDFLAGS="-static -leay32 -L/c/openssl/lib /c/openssl/lib/libeay32.lib"


I already tryed several variations (with -static-libgcc, without  --disable-amalgamation ) but I had no success at all.


Thank you in advance,
Rodrigo

Rodrigo

unread,
Jan 29, 2014, 9:56:06 PM1/29/14
to sqlc...@googlegroups.com
I got it working.

I used the following configuration: ./configure --disable-tcl --with-crypto-lib=none CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl/include/"  LDFLAGS="-static -L/c/openssl/lib -lcrypto -lgdi32"

I also compiled static lybraries from OpenSSL (libcrypto.a).

Ostap Romanko

unread,
Jan 31, 2014, 11:42:41 AM1/31/14
to sqlc...@googlegroups.com
Can somebody help me build SQLCipher on Windows with MinGW. I tried maybe all solutions in this thread in order to set configuration, but nothig help. For example when I type following string 
./configure --disable-tcl --disable-amalgamation CFLAGS="-DSQLITE_HAS_CODEC -I/c/OpenSSL/include /c/OpenSSL/libeay32.dll -L/c/OpenSSL/lib/MinGW" LDFLAGS="-leay32" 
It says that: "Library crypto not found! Install openssl" However I have installed openssl in C:\OpenSSL folder. For some other strings error outputs after cheking whether the C compiler works... no. What's wrong in my strings?

César Rocha

unread,
Feb 7, 2014, 3:51:37 PM2/7/14
to sqlc...@googlegroups.com
Hi Ostap,

I used the same configuration you are using and I got the same problem. In my case the problem was the sqlcipher version I was using. Which version are you using?

I changed to 2.0 stable and everything worked fine.

Stephen Lombardo

unread,
Feb 7, 2014, 4:15:09 PM2/7/14
to sqlc...@googlegroups.com
Hello Ostap, Cesar,

This looks like it's an issue with detecting the OpenSSL libraries. Try adding --with-crypto-lib=none to the configure options, and explicitly adding -DSQLCIPHER_CRYPTO_OPENSSL to the CFLAGS. For instance, using Ostap's original example, something like this:

./configure --disable-tcl --disable-amalgamation --with-crypto-lib=none CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/OpenSSL/include /c/OpenSSL/libeay32.dll -L/c/OpenSSL/lib/MinGW" LDFLAGS="-leay32"

This should eliminate the check for the crypto library at configure time, but still attempt to build SQLCipher using the OpenSSL provider that was introduced in SQLCipher 3.

Cheers,
Stephen


--

César Rocha

unread,
Feb 7, 2014, 4:40:26 PM2/7/14
to sqlc...@googlegroups.com
Hi Stephen,

Thanks for your reply. I had tons of problems but I passed this part and I still have some problems here. I'm following this article: http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support_%28Windows/MinGW%29

I could finish the configuration, "make", "make dll" and "make install", but then int the part "Building the driver" the article says to open the "Qt command prompt" (I'm sorry, I'm new on this, I don't know where this QT command prompt is) to run the "qmake" and the "mingw32-make". I opened the microsoft visual c++ tools and the command prompt, the qmake worked fine, but the "mingw32-make" returned an error that was not found or the command was wrong.

What should I do now to build the driver? I cannot run the mingw32-make. What is missing?

Thanks in advance.
Regards
Cesar

César Rocha

unread,
Feb 8, 2014, 6:39:09 AM2/8/14
to sqlc...@googlegroups.com
Hi,

I could go some steps further, but I got stuck again. I'm sending attached a print screen of my problem.

Do you know what I should do now?

Thanks in advance for any help.

Regards
error.PNG

Stephen Lombardo

unread,
Feb 10, 2014, 5:57:52 PM2/10/14
to sqlc...@googlegroups.com
Hello César,

It looks like make error 255 may be a result of make not finding a command for a particular rule. Have you opened up the Makefile to determine what it is trying to execute at the point of failure?

Cheers,
Stephen

César Rocha

unread,
Feb 11, 2014, 3:01:14 PM2/11/14
to sqlc...@googlegroups.com
Hi Stephen,

It was a sintax problem in the Makefile.Debug, there was a string where it shouldn't be I guess.
I removed and I could go some steps further, but still not working.

The process begins, it shows some files name and then appears a message "The system could not find the file, but I don't know which one or why.
I attached my screen again. Could you please take a look and see if you can figure out?

Thanks again.
Regards,
Cesar Rocha
error.PNG

Stephen Lombardo

unread,
Feb 12, 2014, 1:38:14 PM2/12/14
to sqlc...@googlegroups.com
Hello Cesar,

I'm not intimately familiar with the QT make files, but looking at the output, and error message, I'd strongly suspect a bad newline in the file. From your earlier message, you mentioned there was a string where it shouldn't be, so It sounds like you are making edits to the file. Line 4 of your screenshot sjhows a lib command, line 5 starts with an object file, which make is trying to execute. Try tracking that down in the Makefile and ensure that the objects are on the same line as the lib command.

Cheers,
Stephen

RaelB

unread,
Aug 10, 2014, 8:40:16 AM8/10/14
to sqlc...@googlegroups.com
Hi,

Sigh...  My chance to go through things that don't work :/.

I am trying to compile v3.1.0 using cygwin (terminal) and MinGW compiler. (On WinXP x84, VM. OpenSSL is at C:\OpenSSL. I try to keep things as simple as possible :))

Some of the instructions from Luca and Stephen above have helped me. The following works to configure:

./configure --disable-tcl --with-crypto-lib=none CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -Ic:/OpenSSL/include" LDFLAGS="c:/OpenSSL/lib/libeay32.lib"

Ok. Then I do make. I run in to problem and then use Luca suggestion to edit command line that failed:
i686-pc-mingw32-gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -Ic:/OpenSSL/include -DSQLITE_OS_WIN=1 -I. -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 sqlcipher.exe ./src/shell.c  ./.libs/libsqlcipher.a -lpthread -L/usr/local/lib c:/OpenSSL/lib/libeay32.lib
(He said the libeay32.lib needs to be at the end.)
Press Enter, then that works to build the .exe.

Now I cannot manage to compile the dll.
I try:
make dll

And get this error:


echo 'EXPORTS' >sqlite3.def
nm .libs/sqlite3.o | grep ' T ' | grep ' _sqlite3_' \
        | sed 's/^.* _//' >>sqlite3.def
i686-pc-mingw32-gcc   -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -Ic:/OpenSSL/include -DSQLITE_OS_WIN=1 -I. -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG   -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1  -shared -o sqlite3.dll sqlite3.def \
        -Wl,"--strip-all" .libs/sqlite3.o
.libs/sqlite3.o:sqlite3.c:(.text+0x3b76): undefined reference to `RAND_add'
.libs/sqlite3.o:sqlite3.c:(.text+0x3bb9): undefined reference to `EVP_get_cipherbyname'
.libs/sqlite3.o:sqlite3.c:(.text+0x3bde): undefined reference to `OPENSSL_add_all_algorithms_noconf'
.libs/sqlite3.o:sqlite3.c:(.text+0x3c5e): undefined reference to `EVP_cleanup'
.libs/sqlite3.o:sqlite3.c:(.text+0x3cc6): undefined reference to `RAND_bytes'
.libs/sqlite3.o:sqlite3.c:(.text+0x3cf9): undefined reference to `HMAC_CTX_init'
.libs/sqlite3.o:sqlite3.c:(.text+0x3cfe): undefined reference to `EVP_sha1'
.libs/sqlite3.o:sqlite3.c:(.text+0x3d26): undefined reference to `HMAC_Init_ex'
.libs/sqlite3.o:sqlite3.c:(.text+0x3d42): undefined reference to `HMAC_Update'
.libs/sqlite3.o:sqlite3.c:(.text+0x3d5e): undefined reference to `HMAC_Update'
.libs/sqlite3.o:sqlite3.c:(.text+0x3d7d): undefined reference to `HMAC_Final'
.libs/sqlite3.o:sqlite3.c:(.text+0x3d8b): undefined reference to `HMAC_CTX_cleanup'
.libs/sqlite3.o:sqlite3.c:(.text+0x3dcd): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1'
.libs/sqlite3.o:sqlite3.c:(.text+0x3e0b): undefined reference to `EVP_CipherInit'
.libs/sqlite3.o:sqlite3.c:(.text+0x3e21): undefined reference to `EVP_CIPHER_CTX_set_padding'
.libs/sqlite3.o:sqlite3.c:(.text+0x3e4c): undefined reference to `EVP_CipherInit'
.libs/sqlite3.o:sqlite3.c:(.text+0x3e79): undefined reference to `EVP_CipherUpdate'
.libs/sqlite3.o:sqlite3.c:(.text+0x3eaa): undefined reference to `EVP_CipherFinal'
.libs/sqlite3.o:sqlite3.c:(.text+0x3ec1): undefined reference to `EVP_CIPHER_CTX_cleanup'
.libs/sqlite3.o:sqlite3.c:(.text+0x3edf): undefined reference to `EVP_get_cipherbyname'
.libs/sqlite3.o:sqlite3.c:(.text+0x3efe): undefined reference to `EVP_CIPHER_nid'
.libs/sqlite3.o:sqlite3.c:(.text+0x3f06): undefined reference to `OBJ_nid2sn'
.libs/sqlite3.o:sqlite3.c:(.text+0x3f1b): undefined reference to `EVP_CIPHER_key_length'
.libs/sqlite3.o:sqlite3.c:(.text+0x3f30): undefined reference to `EVP_CIPHER_iv_length'
.libs/sqlite3.o:sqlite3.c:(.text+0x3f45): undefined reference to `EVP_CIPHER_block_size'
.libs/sqlite3.o:sqlite3.c:(.text+0x3f52): undefined reference to `EVP_sha1'
.libs/sqlite3.o:sqlite3.c:(.text+0x3f5a): undefined reference to `EVP_MD_size'
/usr/lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/bin/ld: .libs/sqlite3.o: bad reloc address 0x140 in section `.data'
collect2: error: ld returned 1 exit status
Makefile:1039: recipe for target 'sqlite3.dll' failed

make: *** [sqlite3.dll] Error 1

I tried adding some things in the makefile:

sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
                $(TCC) -shared -o$@ sqlite3.def \
                        -Wl,"--strip-all" $(REAL_LIBOBJ) -LC:\OpenSSL\lib\xxxxxx
but everything I have tried so far has not worked.

Any ideas what's wrong and how to fix?

Thanks
Rael

RaelB

unread,
Aug 11, 2014, 4:44:16 AM8/11/14
to sqlc...@googlegroups.com


I tried adding some things in the makefile:
sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
                $(TCC) -shared -o$@ sqlite3.def \
                        -Wl,"--strip-all" $(REAL_LIBOBJ) -LC:\OpenSSL\lib\xxxxxx
but everything I have tried so far has not worked.


I did manage to get it working for the dll by adding the path in the makefile like so: (no "-L")


sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
                $(TCC) -shared -o$@ sqlite3.def \
                        -Wl,"--strip-all" $(REAL_LIBOBJ) c:/OpenSSL/lib/libeay32.lib

Which is actually similar to the change required for the exe. (This is for MinGW in cygwin.)

In the end, I also managed to compile for MinGW/Msys. This works straight without requiring the above hacks:

./configure --disable-tcl --with-crypto-lib=none CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLCIPHER_CRYPTO_OPENSSL -I/c/OpenSSL/include /c/OpenSSL/libeay32.dll -L/c/OpenSSL/lib/MinGW" LDFLAGS="-leay32"

The main thing for MinGW/Msys is to make sure C:\MinGW\bin is in the system path, that tcl tk is also selected in installed modules, and I also found that I needed to install the pthread module.


Dan Davis

unread,
Aug 21, 2014, 2:51:03 PM8/21/14
to sqlc...@googlegroups.com
For myself, I needed to add --enable-load-extension in order to get the dll to work with SQLiteExpert

using MinGW, my adapted configure:
bash configure --disable-tcl --with-crypto-lib=none --enable-load-extension CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLCIPHER_CRYPTO_OPENSSL -I/c/OpenSSL-Win32/include /c/OpenSSL-Win32/libeay32.dll -L/c/OpenSSL-Win32/lib/MinGW" LDFLAGS="-leay32"


Rael, thank you for your insight and post.

Huy Cong Vu

unread,
Jun 29, 2015, 5:15:27 AM6/29/15
to sqlc...@googlegroups.com
Hi everyone,
I'm trying now to compile SQLCipher under my Windows 7 64 bits without succes even with a lot of readings in this thread.
Here my configuration command line using on MingW msys 1.0 terminal:

./configure --with-crypto-lib=none --disable-tcl --disable-amalgamation CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/d/OpenSSL-win64/include -static-libgcc" LDFLAGS="-L/d/LibExternal/OpenSSL-win64/ -leay32"


Here in d/LibExternal/OpenSSL-win64/ I got libeay32.dll compile by Win64 OpenSSL v1.0.2c (by Shining Light productions) but the config is failed returning:


configure:2912: gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/d/OpenSSL-win64/include -static-libgcc  -L/d/LibExternal/OpenSSL-win64/ -leay32 conftest.c  >&5

/d/LibExternal/OpenSSL-win64//libeay32.dll: file not recognized: File format not recognized


If I remove the linking flags (i.e -leay32), the config runs fine, but here what I got when I compile without amalgamation:


./libtool --mode=compile --tag=CC gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/d/OpenSSL-win64/include -static-libgcc -DSQLITE_OS_WIN=1 -I. -I/d/LibExternal/sqlcipher-master/src -I/d/LibExternal/sqlcipher-master/ext/rtree -I/d/LibExternal/sqlcipher-master/ext/fts3 -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG  -DSQLITE_THREADSAFE=1    -DSQLITE_TEMP_STORE=1 -c /d/LibExternal/sqlcipher-master/src/os_win.c

libtool: compile:  gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/d/OpenSSL-win64/include -static-libgcc -DSQLITE_OS_WIN=1 -I. -I/d/LibExternal/sqlcipher-master/src -I/d/LibExternal/sqlcipher-master/ext/rtree -I/d/LibExternal/sqlcipher-master/ext/fts3 -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=1 -c /d/LibExternal/sqlcipher-master/src/os_win.c  -DDLL_EXPORT -DPIC -o .libs/os_win.o

/d/LibExternal/sqlcipher-master/src/os_win.c: In function `winGetTempname':

/d/LibExternal/sqlcipher-master/src/os_win.c:4372: error: `CCP_POSIX_TO_WIN_W' undeclared (first use in this function)

/d/LibExternal/sqlcipher-master/src/os_win.c:4372: error: (Each undeclared identifier is reported only once

/d/LibExternal/sqlcipher-master/src/os_win.c:4372: error: for each function it appears in.)

/d/LibExternal/sqlcipher-master/src/os_win.c:4372: error: `CCP_POSIX_TO_WIN_A' undeclared (first use in this function)

/d/LibExternal/sqlcipher-master/src/os_win.c: In function `winFullPathname':

/d/LibExternal/sqlcipher-master/src/os_win.c:5081: error: `CCP_POSIX_TO_WIN_W' undeclared (first use in this function)

/d/LibExternal/sqlcipher-master/src/os_win.c:5081: error: `CCP_POSIX_TO_WIN_A' undeclared (first use in this function)

/d/LibExternal/sqlcipher-master/src/os_win.c:5082: error: `CCP_RELATIVE' undeclared (first use in this function)

make: *** [os_win.lo] Error 1


Can anyone tell me where I was wrong? Its been 1 week since I tried to make it work but everything is such a mess. Thanks for any advices.

Cheer, 

Huy Cong

Reply all
Reply to author
Forward
0 new messages