【终端】记录mbedtls库的重新安装

文章讲述了在终端上处理mbedtls库安装问题,涉及libmbedcrypto.14.dylib找不到的错误,提供了卸载重装、更新链接、手动创建软链以及检查动态库路径等解决方案。

记录mbedtls库的在终端上重新安装的步骤

ffmpeg -version
dyld[17464]: Library not loaded: '/usr/local/opt/mbedtls/lib/libmbedcrypto.14.dylib'
  Referenced from: '/usr/local/Cellar/librist/0.2.7_3/lib/librist.4.dylib'
  Reason: tried: '/usr/local/opt/mbedtls/lib/libmbedcrypto.14.dylib' (no such file), '/usr/local/lib/libmbedcrypto.14.dylib' (no such file), '/usr/lib/libmbedcrypto.14.dylib' (no such file), '/usr/local/Cellar/mbedtls/3.5.1/lib/libmbedcrypto.14.dylib' (no such file), '/usr/local/lib/libmbedcrypto.14.dylib' (no such file), '/usr/lib/libmbedcrypto.14.dylib' (no such file)
Abort trap: 6

原因:看起来问题仍然与找不到 libmbedcrypto.14.dylib 文件有关。这可能是由于库文件版本的不匹配或链接问题引起的。

使用以下命令查看依赖于 librist 的软件:

brew uses --installed librist
ffmpeg                     ffmpeg@4                   opencv

这会列出使用(依赖) librist 的所有已安装软件。请注意,这可能包括一些间接依赖关系,因为某些软件可能依赖于其他使用 librist 的软件。

如果您看到列出的软件,尝试先卸载 librist,然后重新安装相关软件。

尝试以下步骤来解决问题:

  1. 重新安装 mbedtls:
    强制卸载 mbedtls 并重新安装:

    brew uninstall --ignore-dependencies mbedtls
    brew install mbedtls
    
  2. 重新安装 librist 和 ffmpeg:
    重新安装 librist 和 ffmpeg:

    brew uninstall librist
    brew uninstall ffmpeg
    brew install librist
    brew install ffmpeg
    
  3. 更新链接:
    执行以下命令重新链接 librist:

    brew unlink librist && brew link librist
    
  4. 手动创建软链接:
    尝试手动创建软链接,将现有的 libmbedcrypto 链接到 libmbedcrypto.14.dylib

    ln -s /usr/local/opt/mbedtls/lib/libmbedcrypto.dylib /usr/local/opt/mbedtls/lib/libmbedcrypto.14.dylib
    
  5. 检查动态库路径:
    确保系统中的动态库路径正确,可以通过以下命令检查:

    echo $DYLD_LIBRARY_PATH
    

    如果没有输出,或者输出为空,请确保将 /usr/local/opt/mbedtls/lib 添加到动态库路径中:

    export DYLD_LIBRARY_PATH="/usr/local/opt/mbedtls/lib:$DYLD_LIBRARY_PATH"
    

完成这些步骤后,再次运行 ffmpeg -version,看看问题是否得到解决。如果问题仍然存在,可能需要更详细地检查系统和软件配置以找出问题的根本原因。

typedef struct mbedtls_x509_crt { int MBEDTLS_PRIVATE(own_buffer); /**< Indicates if \c raw is owned * by the structure or not. */ mbedtls_x509_buf raw; /**< The raw certificate data (DER). */ mbedtls_x509_buf tbs; /**< The raw certificate body (DER). The part that is To Be Signed. */ int version; /**< The X.509 version. (1=v1, 2=v2, 3=v3) */ mbedtls_x509_buf serial; /**< Unique id for certificate issued by a specific CA. */ mbedtls_x509_buf sig_oid; /**< Signature algorithm, e.g. sha1RSA */ mbedtls_x509_buf issuer_raw; /**< The raw issuer data (DER). Used for quick comparison. */ mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). Used for quick comparison. */ mbedtls_x509_name issuer; /**< The parsed issuer data (named information object). */ mbedtls_x509_name subject; /**< The parsed subject data (named information object). */ mbedtls_x509_time valid_from; /**< Start time of certificate validity. */ mbedtls_x509_time valid_to; /**< End time of certificate validity. */ mbedtls_x509_buf pk_raw; mbedtls_pk_context pk; /**< Container for the public key context. */ mbedtls_x509_buf issuer_id; /**< Optional X.509 v2/v3 issuer unique identifier. */ mbedtls_x509_buf subject_id; /**< Optional X.509 v2/v3 subject unique identifier. */ mbedtls_x509_buf v3_ext; /**< Optional X.509 v3 extensions. */ mbedtls_x509_sequence subject_alt_names; /**< Optional list of raw entries of Subject Alternative Names extension (currently only dNSName and OtherName are listed). */ mbedtls_x509_sequence certificate_policies; /**< Optional list of certificate policies (Only anyPolicy is printed and enforced, however the rest of the policies are still listed). */ int MBEDTLS_PRIVATE(ext_types); /**< Bit string containing detected and parsed extensions */ int MBEDTLS_PRIVATE(ca_istrue); /**< Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. */ int MBEDTLS_PRIVATE(max_pathlen); /**< Optional Basic Constraint extension value: The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+ */ unsigned int MBEDTLS_PRIVATE(key_usage); /**< Optional key usage extension value: See the values in x509.h */ mbedtls_x509_sequence ext_key_usage; /**< Optional list of extended key usage OIDs. */ unsigned char MBEDTLS_PRIVATE(ns_cert_type); /**< Optional Netscape certificate type extension value: See the values in x509.h */ mbedtls_x509_buf MBEDTLS_PRIVATE(sig); /**< Signature: hash of the tbs part signed with the private key. */ mbedtls_md_type_t MBEDTLS_PRIVATE(sig_md); /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ mbedtls_pk_type_t MBEDTLS_PRIVATE(sig_pk); /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ void *MBEDTLS_PRIVATE(sig_opts); /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ /** Next certificate in the linked list that constitutes the CA chain. * \p NULL indicates the end of the list. * Do not modify this field directly. */ struct mbedtls_x509_crt *next; } mbedtls_x509_crt; 怎么确定哪个是用户证书
07-07
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值