SQLCipher + POCO C ++

时间:2012-06-08 08:20:07

标签: sqlite build sqlcipher poco-libraries

我正在尝试用我的Mac Lion上的sqlcipher替换POCO的sqlite。关于构建过程和替换,没有太多信息,但我想我应该试一试。

我有sqlcipher合并,然后我用sqlcipher的那些替换了Data / Sqlite / src Poco目录中的sqlite3.c和sqlite3.h,将SQLITE_HAS_CODEC和SQLITE_TEMP_STORE = 2参数添加到Makefile中并尝试过建立这整件事。

但是我收到以下错误:

Undefined symbols for architecture x86_64:
  "_EVP_get_cipherbyname", referenced from:
      _sqlcipher_activate in sqlite3.o
      _sqlcipher_codec_ctx_set_cipher in sqlite3.o
  "_OPENSSL_add_all_algorithms_noconf", referenced from:
      _sqlcipher_activate in sqlite3.o
  "_RAND_bytes", referenced from:
      _sqlcipher_random in sqlite3.o
  "_EVP_CIPHER_key_length", referenced from:
      _sqlcipher_codec_ctx_set_cipher in sqlite3.o
  "_EVP_CIPHER_iv_length", referenced from:
      _sqlcipher_codec_ctx_set_cipher in sqlite3.o
  "_EVP_CIPHER_block_size", referenced from:
      _sqlcipher_codec_ctx_set_cipher in sqlite3.o
  "_EVP_sha1", referenced from:
      _sqlcipher_codec_ctx_set_cipher in sqlite3.o
      _sqlcipher_page_hmac in sqlite3.o
  "_EVP_MD_size", referenced from:
      _sqlcipher_codec_ctx_set_cipher in sqlite3.o
  "_HMAC_CTX_init", referenced from:
      _sqlcipher_page_hmac in sqlite3.o
  "_HMAC_Init_ex", referenced from:
      _sqlcipher_page_hmac in sqlite3.o
  "_HMAC_Update", referenced from:
      _sqlcipher_page_hmac in sqlite3.o
  "_HMAC_Final", referenced from:
      _sqlcipher_page_hmac in sqlite3.o
  "_HMAC_CTX_cleanup", referenced from:
      _sqlcipher_page_hmac in sqlite3.o
  "_EVP_CipherInit", referenced from:
      _sqlcipher_page_cipher in sqlite3.o
  "_EVP_CIPHER_CTX_set_padding", referenced from:
      _sqlcipher_page_cipher in sqlite3.o
  "_EVP_CipherUpdate", referenced from:
      _sqlcipher_page_cipher in sqlite3.o
  "_EVP_CipherFinal", referenced from:
      _sqlcipher_page_cipher in sqlite3.o
  "_EVP_CIPHER_CTX_cleanup", referenced from:
      _sqlcipher_page_cipher in sqlite3.o
  "_PKCS5_PBKDF2_HMAC_SHA1", referenced from:
      _sqlcipher_cipher_ctx_key_derive in sqlite3.o
ld: symbol(s) not found for architecture x86_64

以前有人试过这个吗?有人知道这方面的潜在解决方案吗?谢谢!

1 个答案:

答案 0 :(得分:4)

这些是OpenSSL符号,因此您可能没有链接到libcrypto。将-lcrypto添加到链接器标志。