gpt4 book ai didi

xcode - 框架不断在错误的位置搜索 - 如何使用 install_name_tool?

转载 作者:行者123 更新时间:2023-12-03 16:57:15 26 4
gpt4 key购买 nike

我正在尝试添加 OPN 框架,以添加对从 Opticon 手持扫描仪设备导入批处理的支持。我将框架添加到项目中

enter image description here

在复制构建阶段添加它

enter image description here

并添加了运行路径搜索路径

enter image description here

我一开始得到的完整错误是这个:

dyld: Library not loaded: /Users/[original developer of framework]/Development/Mac OPN API/trunk/Sources/opn_api/build/OPN API.build/Release/OPN.build/Objects-normal/i386/OPN
Referenced from: /Volumes/Hard Disk Drive/users/[My name]/Library/Developer/Xcode/DerivedData/barcode-test2-dvksadjkbyeilghbcdcgfqwrvwcb/Build/Products/Debug/barcode-test2.app/Contents/MacOS/barcode-test2
Reason: image not found

我认为我正在获取开发人员硬盘驱动器的本地路径,因为这可能是意外留下的,并且是它在最终失败之前尝试解决的最后一条路径。

当我检查框架是否复制到正确的目录时,我发现我确实将其复制到了 Frameworks 文件夹中。

当我使用 otool 检查路径时,我在任何地方都看不到正确的路径:

My-MacBook:MacOS me$ otool barcode-test2 -L barcode-test2: /Users/[Original developer]/Development/Mac OPN API/trunk/Sources/opn_api/build/OPN API.build/Release/OPN.build/Objects-normal/i386/OPN (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 19.0.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.18.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1187.39.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.19.0)

OPN 二进制文件上的 otool:

My-MacBook:OPN.framework me$ otool -L OPN OPN (architecture i386): /Users/[Original Developer]/Development/Mac OPN API/trunk/Sources/opn_api/build/OPN API.build/Release/OPN.build/Objects-normal/i386/OPN (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 368.35.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.11) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 18.0.0) OPN (architecture ppc): /Users/[Original Developer]/Development/Mac OPN API/trunk/Sources/opn_api/build/OPN API.build/Release/OPN.build/Objects-normal/ppc/OPN (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 368.35.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.11) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 18.0.0)

我不应该在此处看到类似 @executable_path/../Frameworks/或其已解析版本的内容吗?

我在正确的位置添加了 OPN 文件,并确保它现在可以构建,但我真的不喜欢仅仅为了进行此构建而在我的 Users 目录中拥有完整的额外路径。

我尝试了 install_name_tool 的许多变体,但每次执行该命令时,它都不会给出错误或确认,当我再次使用 otool -L 检查时,没有任何变化。

最佳答案

@executable_path/../Frameworks添加到OPN框架build设置的安装目录中。

enter image description here

关于xcode - 框架不断在错误的位置搜索 - 如何使用 install_name_tool?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25417880/

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