CocoaLibSpotify - Library not loaded

旧街凉风 提交于 2019-12-11 08:19:28

问题


I've created a simple mac app that uses the Cocoa wrapper for libspotify.

When I export the project as an Application and try to run it, it crashes immediately.

Crash report:

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 output:

$ 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)

Project - Build Phases

Any ideas?

回答1:


The Runtime Search Paths build setting in your project needs to contain @loader_path/../Frameworks to tell the dynamic linker where to find CocoaLibSpotify at runtime.

See Linking and Install Names by Mike Ash for a detailed discussion.



来源:https://stackoverflow.com/questions/22265408/cocoalibspotify-library-not-loaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!