sqlcipheron MacOS HighSierra生成错误

sqlcipheron MacOS HighSierra生成错误,macos,sqlcipher,Macos,Sqlcipher,我从MacOS上的github存储库构建sqlcipher: 9429:sqlcipher administrator$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_UNLOCK_NOTIFY" checking build system type... i386-apple-darwin17.4.0 ... config.status: creating config.h con

我从MacOS上的github存储库构建sqlcipher:

9429:sqlcipher administrator$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_UNLOCK_NOTIFY"
checking build system type... i386-apple-darwin17.4.0

...

config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
9429:sqlcipher administrator$ make
./libtool --mode=link gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/Users/administrator/pjx/sqlcipher/src -I/Users/administrator/pjx/sqlcipher/ext/rtree -I/Users/administrator/pjx/sqlcipher/ext/icu -I/Users/administrator/pjx/sqlcipher/ext/fts3 -I/Users/administrator/pjx/sqlcipher/ext/async -I/Users/administrator/pjx/sqlcipher/ext/session -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG  -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY     -no-undefined -o libsqlcipher.la sqlite3.lo -lcrypto   \
         -rpath "/usr/local/lib" -version-info "8:6:8"
libtool: link: gcc -dynamiclib  -o .libs/libsqlcipher.0.dylib  .libs/sqlite3.o   -lcrypto    -install_name  /usr/local/lib/libsqlcipher.0.dylib -compatibility_version 9 -current_version 9.6 -Wl,-single_module
Undefined symbols for architecture x86_64:
  "_HMAC_CTX_free", referenced from:
      _sqlcipher_openssl_hmac in sqlite3.o
  "_HMAC_CTX_new", referenced from:
      _sqlcipher_openssl_hmac in sqlite3.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libsqlcipher.la] Error 1
我犯了什么错


什么是“\u HMAC\u CTX\u free”错误?

我也有同样的问题。解决方案是使用OpenSSL静态编译。 您需要在./configure命令中指定静态库

./configure --enable-tempstore=yes \
CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_UNLOCK_NOTIFY"\
LDFLAGS="/usr/local/lib/libcrypto.a"

make
不要忘记链接正确的库libcrypto.a