【问题标题】:link against 'Current' version of Python.framework链接到 Python.framework 的“当前”版本
【发布时间】:2012-11-01 02:37:23
【问题描述】:

我有一个链接到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

【问题讨论】:

    标签: xcode macos frameworks linker


    【解决方案1】:

    设置 Target 的 Link Binary with Libraries 允许您使用许多不同的版本。使用 unversioned libpython.dyld(顶部):

    【讨论】:

    • 我使用了 libpython2.6.dylib,因为它使测试更容易。不过谢谢!
    【解决方案2】:

    您无法链接到“当前”版本,因为它可能会更新为指向从根本上破坏您链接的库接口的较新版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多