CocoaLibSpotify - 库未加载(CocoaLibSpotify - Library

2019-10-19 12:18发布

我创建了一个使用可可包装的libspotify一个简单的Mac应用程序。

当我出口项目作为一个应用程序,并尝试运行它,它会立即崩溃。

崩溃报告:

Application Specific Information:
  dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: @rpath/CocoaLibSpotify.framework/Versions/A/CocoaLibSpotify
  Referenced from: /Users/USER/Desktop/Wunderkiste.app/Contents/MacOS/Wunderkiste
  Reason: image not found

otool输出:

$ otool -L ~/Desktop/Wunderkiste.app/Contents/MacOS/Wunderkiste 
    @rpath/CocoaLibSpotify.framework/Versions/A/CocoaLibSpotify (compatibility version         1.0.0, current version 1.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 20.0.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1056.0.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 1197.1.1)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1265.0.0)
    /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData (compatibility version 1.0.0, current version 481.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.11.0)

项目 - 构建阶段

有任何想法吗?

Answer 1:

Runtime Search Paths建立在你的项目设置需要包含@loader_path/../Frameworks告诉动态链接程序运行时所找到CocoaLibSpotify。

见链接和安装名称由Mike灰进行了详细的讨论。



文章来源: CocoaLibSpotify - Library not loaded