2012-04-30 28 views
2

私はLinux用のビルドsqlcipherを持っていますが、opensslに依存しています。私は静的にそれをリンクして外部opensslライブラリなしで動作するようにsqlcipherを設定したい。 私は、このコマンドでsqlcipherその後静的リンクopensslからsqlcipher

./configure --prefix=/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/ --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="/usr/lib64/libcrypto.a" 
make 

を設定私は次の文字列を得た:

/libtool --mode=link gcc -DSQLITE_HAS_CODEC -DSQLITE_OS_UNIX=1 -I. -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -I/usr/include -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 /usr/lib64/libcrypto.a -DHAVE_READLINE=0 \ 
       -o sqlite3 ./src/shell.c libsqlite3.la \ 
       -lpthread -rpath "/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/lib" 
libtool: link: gcc -DSQLITE_HAS_CODEC -DSQLITE_OS_UNIX=1 -I. -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -I/usr/include -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DHAVE_READLINE=0 -o sqlite3 ./src/shell.c /usr/lib64/libcrypto.a ./.libs/libsqlite3.a -lpthread -Wl,-rpath -Wl,/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/lib 
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_activate': 
sqlite3.c:(.text+0xb66): undefined reference to `EVP_get_cipherbyname' 
sqlite3.c:(.text+0xb70): undefined reference to `OPENSSL_add_all_algorithms_noconf' 
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_random': 
sqlite3.c:(.text+0xc0c): undefined reference to `RAND_bytes' 
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_codec_ctx_set_cipher': 
sqlite3.c:(.text+0x11a2): undefined reference to `EVP_get_cipherbyname' 
sqlite3.c:(.text+0x11ba): undefined reference to `EVP_CIPHER_key_length' 
sqlite3.c:(.text+0x11d4): undefined reference to `EVP_CIPHER_iv_length' 
sqlite3.c:(.text+0x11ee): undefined reference to `EVP_CIPHER_block_size' 
sqlite3.c:(.text+0x11fd): undefined reference to `EVP_sha1' 
sqlite3.c:(.text+0x1205): undefined reference to `EVP_MD_size' 
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_page_hmac': 
sqlite3.c:(.text+0x1880): undefined reference to `HMAC_CTX_init' 
sqlite3.c:(.text+0x1885): undefined reference to `EVP_sha1' 
sqlite3.c:(.text+0x18b9): undefined reference to `HMAC_Init_ex' 
sqlite3.c:(.text+0x18d9): undefined reference to `HMAC_Update' 
sqlite3.c:(.text+0x18f8): undefined reference to `HMAC_Update' 
sqlite3.c:(.text+0x1917): undefined reference to `HMAC_Final' 
sqlite3.c:(.text+0x1929): undefined reference to `HMAC_CTX_cleanup' 
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_page_cipher': 
sqlite3.c:(.text+0x1b35): undefined reference to `EVP_CipherInit' 
sqlite3.c:(.text+0x1b4a): undefined reference to `EVP_CIPHER_CTX_set_padding' 
sqlite3.c:(.text+0x1b7a): undefined reference to `EVP_CipherInit' 
sqlite3.c:(.text+0x1ba2): undefined reference to `EVP_CipherUpdate' 
sqlite3.c:(.text+0x1bcc): undefined reference to `EVP_CipherFinal' 
sqlite3.c:(.text+0x1be2): undefined reference to `EVP_CIPHER_CTX_cleanup' 
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_cipher_ctx_key_derive': 
sqlite3.c:(.text+0x1d3a): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1' 
sqlite3.c:(.text+0x1e08): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1' 
collect2: ld returned 1 exit status 
make: *** [sqlite3] Error 1 

Iは、OpenSSLとOpenSSL-devのパッケージをインストールしていると/usr/lib64/libcrypto.aが存在します。 私は間違っていますか?

+0

LDFLAGS = " - lcrypto" everethingはOKです。しかし、whith LDFLAGS = "/ usr/lib64/libcrypto.a"私はこれらのエラーがあります。 – dream2work

答えて

1

OpenSSLヘッダーファイルへのパスを含めるようにCFLAGSを調整します。このようなもの:

CFLAGS="-DSQLITE_HAS_CODEC -I/path/to/openssl/include" 
+0

ヘッダーを見つけて私のコマンドに入れました ./configure --prefix =/home/admin/Downloads/qt-everywhere-opensource-src-4.8.1/src/plugins/sqldrivers/sqlcipher/--disable-shared --enable-tempstore = yes CFLAGS = " - DSQLITE_HAS_CODEC -I/usr/include/openssl" LDFLAGS = "/ usr/lib64/libcrypto.a" 何も変更されていません。私は同じエラーがあります。 – dream2work

関連する問題