gpt4 book ai didi

c++ - 当我添加库 : dyld: Library not loaded 时,Xcode 出错

转载 作者:行者123 更新时间:2023-12-01 23:27:11 30 4
gpt4 key购买 nike

起初我想在 xcode 中学习 SDL,但是当我尝试添加 SDL 框架时弹出这个错误,我不明白为什么。我在互联网上看了 2 天,但找不到任何解决方案。 1 个月后(现在)我正在尝试将 GLFW 添加到 xcode,但这个错误又让我失望了。为什么会出现此错误?

dyld: Library not loaded: /usr/local/opt/glfw/lib/libglfw.3.dylib
Referenced from: /Users/durdukolk/Library/Developer/Xcode/DerivedData/Graphic-dutmtfjytmmfetggltqeajfkggms/Build/Products/Debug/Graphic
Reason: no suitable image found. Did find:
/usr/local/opt/glfw/lib/libglfw.3.dylib: code signature in (/usr/local/opt/glfw/lib/libglfw.3.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
/usr/local/Cellar/glfw/3.3.4/lib/libglfw.3.3.dylib: code signature in (/usr/local/Cellar/glfw/3.3.4/lib/libglfw.3.3.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

Link Binary with libraries

Search Paths

最佳答案

我终于找到了解决方案。首先,您需要在项目文件中的签名部分打开“启用强化运行时”。 Project Name -> Build Setting -> Signing -> Enable Hardened Runtime

并且需要在产品菜单中勾选“禁用库验证”。 Target Name -> Signing & Capabilities -> Hardened Runtime -> Disable Library Validation

更多详情:https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation

关于c++ - 当我添加库 : dyld: Library not loaded 时,Xcode 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67049987/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com