2012-11-12 34 views
1

我有一個二進制文件,我鏈接到Python.framework針對當前版本的Python.framework鏈接

通過otool -L <binary>,它似乎鏈接到完整的符號鏈接解析路徑,即/System/Library/Frameworks/Python.framework/Versions/2.7/Python而不是/System/Library/Frameworks/Python.framework/Versions/Current/Python。從只有Python的2.6框架的用戶,我也得到了它拋出這個錯誤報告:

Dyld Error Message: 
    Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.7/Python 
    Referenced from: /Applications/MusicPlayer.app/Contents/MacOS/MusicPlayer 
    Reason: image not found 

我怎麼能告訴Xcode中,它應該鏈接到/System/Library/Frameworks/Python.framework/Versions/Current/Python

回答

0

設置目標的Link Binary with Libraries允許您使用許多不同的版本。使用無版本libpython.dyld(上一個):

enter image description here

+0

我使用libpython2.6.dylib,因爲它使測試更容易。但是,謝謝! – Albert

0

不能鏈接到「當前」版本,因爲它可能被更新爲指向,從根本上打破了庫接口的新版本,你」重新對抗。