SQLCipher build error on Ubuntu (C compiler)

Hi, first time trying to compile sqlcipher from source.

I’m using the following command:
./configure --enable-tempstore=no CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"

and i’m getting the following error:
checking for gcc… gcc
checking whether the C compiler works… no
configure: error: in /home/student/sqlcipher': configure: error: C compiler cannot create executables See config.log’ for more details

I’ve tried several things such as reinstalling build essentials or even building statically but no luck there either.

config.log file contents:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by sqlcipher configure 3.34.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

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

---------

Platform.

---------

hostname = student-VirtualBox
uname -m = x86_64
uname -r = 5.4.0-73-generic
uname -s = Linux
uname -v = #82~18.04.1-Ubuntu SMP Fri Apr 16 15:10:02 UTC 2021

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin

-----------

Core tests.

-----------

configure:2391: checking build system type
configure:2405: result: x86_64-pc-linux-gnu
configure:2425: checking host system type
configure:2438: result: x86_64-pc-linux-gnu
configure:2479: checking how to print strings
configure:2506: result: printf
configure:2575: checking for gcc
configure:2591: found /usr/bin/gcc
configure:2602: result: gcc
configure:2831: checking for C compiler version
configure:2840: gcc --version >&5
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2851: $? = 0
configure:2840: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 7.5.0-3ubuntu1~18.04’ --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
configure:2851: $? = 0
configure:2840: gcc -V >&5
gcc: error: unrecognized command line option ‘-V’
gcc: fatal error: no input files
compilation terminated.
configure:2851: $? = 1
configure:2840: gcc -qversion >&5
gcc: error: unrecognized command line option ‘-qversion’; did you mean ‘–version’?
gcc: fatal error: no input files
compilation terminated.
configure:2851: $? = 1
configure:2871: checking whether the C compiler works
configure:2893: gcc -DSQLITE_HAS_CODEC -lcrypto conftest.c >&5
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
configure:2897: $? = 1
configure:2935: result: no
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME “sqlcipher”
| #define PACKAGE_TARNAME “sqlcipher”
| #define PACKAGE_VERSION “3.34.1”
| #define PACKAGE_STRING “sqlcipher 3.34.1”
| #define PACKAGE_BUGREPORT “”
| #define PACKAGE_URL “”
| /
end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2940: error: in /home/student/sqlcipher': configure:2942: error: C compiler cannot create executables See config.log’ for more details

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

Cache variables.

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

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-DSQLITE_HAS_CODEC
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-lcrypto
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_TCLLIBDIR_set=
ac_cv_env_TCLLIBDIR_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-pc-linux-gnu
ac_cv_prog_ac_ct_CC=gcc

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

Output variables.

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

ALLOWRELEASE=’’
AR=’’
AWK=’’
BUILD_CC=’’
BUILD_CFLAGS=’’
BUILD_EXEEXT=’’
CC=‘gcc’
CFLAGS=’-DSQLITE_HAS_CODEC’
CPP=’’
CPPFLAGS=’’
DEFS=’’
DLLTOOL=’’
DSYMUTIL=’’
DUMPBIN=’’
ECHO_C=’’
ECHO_N=’-n’
ECHO_T=’’
EGREP=’’
EXEEXT=’’
FGREP=’’
GREP=’’
HAVE_TCL=’’
HAVE_ZLIB=’’
INSTALL_DATA=’’
INSTALL_PROGRAM=’’
INSTALL_SCRIPT=’’
LD=’’
LDFLAGS=’-lcrypto’
LIBOBJS=’’
LIBS=’’
LIBTOOL=’’
LIPO=’’
LN_S=’’
LTLIBOBJS=’’
LT_SYS_LIBRARY_PATH=’’
MANIFEST_TOOL=’’
NM=’’
NMEDIT=’’
OBJDUMP=’’
OBJEXT=’’
OPT_FEATURE_FLAGS=’’
OTOOL64=’’
OTOOL=’’
PACKAGE_BUGREPORT=’’
PACKAGE_NAME=‘sqlcipher’
PACKAGE_STRING=‘sqlcipher 3.34.1’
PACKAGE_TARNAME=‘sqlcipher’
PACKAGE_URL=’’
PACKAGE_VERSION=‘3.34.1’
PATH_SEPARATOR=’:’
RANLIB=’’
RELEASE=’’
SED=’’
SHELL=’/bin/bash’
SQLITE_OS_UNIX=’’
SQLITE_OS_WIN=’’
SQLITE_THREADSAFE=’’
STRIP=’’
TARGET_DEBUG=’’
TARGET_EXEEXT=’’
TARGET_HAVE_EDITLINE=’’
TARGET_HAVE_READLINE=’’
TARGET_READLINE_INC=’’
TARGET_READLINE_LIBS=’’
TCLLIBDIR=’’
TCLSH_CMD=’’
TCL_BIN_DIR=’’
TCL_INCLUDE_SPEC=’’
TCL_LIB_FILE=’’
TCL_LIB_FLAG=’’
TCL_LIB_SPEC=’’
TCL_SHLIB_SUFFIX=’’
TCL_SRC_DIR=’’
TCL_STUB_LIB_FILE=’’
TCL_STUB_LIB_FLAG=’’
TCL_STUB_LIB_SPEC=’’
TCL_VERSION=’’
TEMP_STORE=’’
USE_AMALGAMATION=’’
USE_GCOV=’’
VERSION=’’
XTHREADCONNECT=’’
ac_ct_AR=’’
ac_ct_CC=‘gcc’
ac_ct_DUMPBIN=’’
bindir=’${exec_prefix}/bin’
build=‘x86_64-pc-linux-gnu’
build_alias=’’
build_cpu=‘x86_64’
build_os=‘linux-gnu’
build_vendor=‘pc’
datadir=’${datarootdir}’
datarootdir=’${prefix}/share’
docdir=’${datarootdir}/doc/${PACKAGE_TARNAME}’
dvidir=’${docdir}’
exec_prefix=‘NONE’
host=‘x86_64-pc-linux-gnu’
host_alias=’’
host_cpu=‘x86_64’
host_os=‘linux-gnu’
host_vendor=‘pc’
htmldir=’${docdir}’
includedir=’${prefix}/include’
infodir=’${datarootdir}/info’
libdir=’${exec_prefix}/lib’
libexecdir=’${exec_prefix}/libexec’
localedir=’${datarootdir}/locale’
localstatedir=’${prefix}/var’
mandir=’${datarootdir}/man’
oldincludedir=’/usr/include’
pdfdir=’${docdir}’
prefix=‘NONE’
program_prefix=‘NONE’
program_transform_name=‘s,x,x,’
psdir=’${docdir}’
runstatedir=’${localstatedir}/run’
sbindir=’${exec_prefix}/sbin’
sharedstatedir=’${prefix}/com’
sysconfdir=’${prefix}/etc’
target_alias=’’

-----------

confdefs.h.

-----------

/* confdefs.h */
#define PACKAGE_NAME “sqlcipher”
#define PACKAGE_TARNAME “sqlcipher”
#define PACKAGE_VERSION “3.34.1”
#define PACKAGE_STRING “sqlcipher 3.34.1”
#define PACKAGE_BUGREPORT “”
#define PACKAGE_URL “”

configure: exit 77

help.

Hi @jriddell,

Your local system is unable to locate the OpenSSL libcrypto library for linking purposes. You will need to provide that in order to build the software.

So i managed to dynamically link it after installing libssl-dev. After that it gave me an error about tclsh so I installed tcl. Now the make command spits out a giant error. I can’t attach it as a file because i’m a new user, but the non-error output is:

./libtool --mode=compile --tag=CC gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/home/student/sqlcipher/src -I/home/student/sqlcipher/ext/rtree -I/home/student/sqlcipher/ext/icu -I/home/student/sqlcipher/ext/fts3 -I/home/student/sqlcipher/ext/async -I/home/student/sqlcipher/ext/session -I/home/student/sqlcipher/ext/userauth -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=2 -c sqlite3.c
libtool: compile: gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/home/student/sqlcipher/src -I/home/student/sqlcipher/ext/rtree -I/home/student/sqlcipher/ext/icu -I/home/student/sqlcipher/ext/fts3 -I/home/student/sqlcipher/ext/async -I/home/student/sqlcipher/ext/session -I/home/student/sqlcipher/ext/userauth -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=2 -c sqlite3.c -fPIC -DPIC -o .libs/sqlite3.o
Makefile:801: recipe for target ‘sqlite3.lo’ failed

Any tips on how to get this working?

Hi @jriddell

Can you post the full build output as a GitHub Gist here?

OK, posted here:

Hi @jriddell

What happens when you rerun your specific ./configure command, then run make clean, followed by make?

That did the trick. Apparently i was also running out of space, once i made some room, the ./configure, make clean, then make worked. Thank you

Hi @jriddell

Glad to hear you were able to complete the build. Take care!