我试图在Mac Lion上用sqlcipher替换POCO的sqlite。关于构建过程和替换的信息不多,但是我认为应该尝试一下。

我已经将sqlcipher合并,然后用sqlcipher的目录替换了Data / Sqlite / src Poco目录中的sqlite3.c和sqlite3.h,并在Makefile中添加了SQLITE_HAS_CODEC和SQLITE_TEMP_STORE = 2参数,并尝试构建它整件事情。

但是我收到以下错误:

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


有人尝试过吗?有人知道对此有潜在的解决方法吗?谢谢!

最佳答案

这些是OpenSSL符号,因此您可能未针对libcrypto进行链接。将-lcrypto添加到链接器标志。

关于sqlite - SQLCipher + POCO C++,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10945319/

10-11 03:23