【问题标题】:linker error when linking libcrypto.dylib链接 libcrypto.dylib 时出现链接器错误
【发布时间】:2020-12-28 11:15:08
【问题描述】:

macOS 10.14.3、Xcode 9.4.1:

我正在尝试在我的项目中使用podofo。我收到以下错误:

ld: warning: ignoring file /usr/local/lib/libcrypto.dylib, file was built for unsupported file format ( 0x62 0x6F 0x6F 0x6B 0x00 0x00 0x00 0x00 0x6D 0x61 0x72 0x6B 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): /usr/local/lib/libcrypto.dylib
ld: warning: ignoring file /usr/local/lib/libcrypto.dylib, file was built for unsupported file format ( 0x62 0x6F 0x6F 0x6B 0x00 0x00 0x00 0x00 0x6D 0x61 0x72 0x6B 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): /usr/local/lib/libcrypto.dylib
Undefined symbols for architecture x86_64:
  "_EVP_CIPHER_CTX_free", referenced from:
      PoDoFo::RC4CryptoEngine::~RC4CryptoEngine() in libpodofo.a(PdfEncrypt.o)
      PoDoFo::AESCryptoEngine::~AESCryptoEngine() in libpodofo.a(PdfEncrypt.o)
  "_EVP_CIPHER_CTX_new", referenced from:
      PoDoFo::RC4CryptoEngine::RC4CryptoEngine() in libpodofo.a(PdfEncrypt.o)
      PoDoFo::AESCryptoEngine::AESCryptoEngine() in libpodofo.a(PdfEncrypt.o)

我做错了什么?这是什么意思?

非常感谢您的宝贵时间。

【问题讨论】:

    标签: macos openssl libcrypto


    【解决方案1】:
    0x62 0x6F 0x6F 0x6B 0x00 0x00 0x00 0x00 0x6D 0x61 0x72 0x6B 0x00 0x00 0x00 0x00
    

    Ascii 是BOOK MARK

    这里的/usr/local/lib/libcrypto.dylib实际上是你要在程序中链接的库吗?

    【讨论】:

    • '/usr/local/lib/libcrypto.dylib' 是一个软链接。该库是'/usr/local/Cellar/openssl@1.1/1.1.1i/lib/libcrypto.lib'。
    • 我把它复制到 /usr/local/lib.成功了!非常感谢。
    猜你喜欢
    • 2018-12-11
    • 2012-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多