Error building SqlCipher on Ubuntu 12.04 LTS x86_64


#1

Hello,

When I try to build SQLCipher on Ubuntu 12.04 LTS,

I’m using these arguments for configure:

$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
$ make

I get the following errors:

./libtool --mode=compile --tag=CC gcc -DSQLITE3_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/home/dev/Downloads/sqlcipher/src -I/home/dev/Downloads/sqlcipher/ext/rtree -I/home/dev/Downloads/sqlcipher/ext/fts3 -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG  -DSQLITE_THREADSAFE=1    -DSQLITE_TEMP_STORE=2 -c sqlite3.c
libtool: compile:  gcc -DSQLITE3_HAS_COTEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/home/dev/Downloads/sqlcipher/src -I/home/dev/Downloads/sqlcipher/ext/rtree -I/home/dev/Downloads/sqlcipher/ext/fts3 -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=2 -c sqlite3.c  -fPIC -DPIC -o .libs/sqlite3.o
sqlite3.c:29528:40: error: ‘mmap’ undeclared here (not in a function)
sqlite3.c:29531:42: error: ‘munmap’ undeclared here (not in a function)
sqlite3.c:29535:42: error: ‘mremap’ undeclared here (not in a function)
sqlite3.c: In function ‘unixShmMap’:
sqlite3.c:33582:36: error: ‘PROT_READ’ undeclared (first use in this function)
sqlite3.c:33582:36: note: each undeclared identifier is reported only once for each function it appears in
sqlite3.c:33582:58: error: ‘PROT_WRITE’ undeclared (first use in this function)
sqlite3.c:33582:57: error: invalid operands to binary | (have ‘struct unix_syscall *’ and ‘struct unix_syscall *’)
sqlite3.c:33583:13: error: ‘MAP_SHARED’ undeclared (first use in this function)
sqlite3.c:33584:9: warning: passing argument 3 of ‘(void * (*)(void *, size_t,  int,  int,  int,  
make: *** [sqlite3.lo] Error 1

There is hundreds of errors such as these. Please help!


#2

Hello @devilfish_mm

Can you double-check the ./configure value you provided? What you typed above shows the CFLAGS includes -DSQLITE_HAS_CODEC, however your error message says -DSQLITE3_HAS_CODEC. If you still have the original build available, you can check what you passed to ./configure by invoking:

./config.status --config

The value provided to ./configure should be -DSQLITE_HAS_CODEC.


#3

Looks like I had -DSQLITE3_HAS_CODEC for some reason. Might have typed it wrong or still had it in the configuration file from a previous build. It has been fixed :smile:

Thanks for the help!


#4

Hi @devilfish_mm

Glad to hear that resolve the issue. Take care!