简体   繁体   English

将10.5(Leopard)的PyObjC应用程序编译为xcode 10.6(Snow Leopard)

[英]Compiling a PyObjC application for 10.5 (Leopard) into xcode 10.6 (Snow Leopard)

I'm trying to deploy on 10.5 a PyObjC (or Cocoa-Python) application developed on Xcode 3.2.X (Snow Leopard) which runs perfectly fine on 10.6 systems. 我正在尝试在10.5上部署一个在Xcode 3.2.X(Snow Leopard)上开发的PyObjC(或Cocoa-Python)应用程序,它在10.6系统上运行得非常好。

The application doesn't launch on 10.5;it crashes at launch giving this error message (found on Crash Report): 该应用程序不会在10.5上启动;它会在启动时崩溃,并显示此错误消息(在崩溃报告中找到):

Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.6/Python Referenced from: /Users/myuser/Documents/myApp.app/Contents/MacOS/myApp Reason: image not found Dyld错误消息:未加载库:/System/Library/Frameworks/Python.framework/Versions/2.6/Python引用自:/Users / myuser / Files / myApp.app / Constate / Mark / myApp原因:未找到图像

Seems that somewhere Xcode hardcodes the Versions/2.6 python framework path (instead of setting it as Versions/Current, for example). 似乎在某处Xcode硬编码Versions / 2.6 python框架路径(而不是将其设置为Versions / Current,例如)。

However, I was not able to find where this link path could be modified to be set to Current (or to 2.5, maybe conditionally)... 但是,我无法找到可以修改此链接路径的位置以设置为当前(或2.5,可能是有条件的)...

The path you're seeing may very well be a legitimate path to the version of the Python framework you linked against. 您所看到的路径很可能是您链接的Python框架版本的合法路径。 That's the correct path for the most recent version of SnowLeopard (10.6.5), at least. 这是最新版SnowLeopard(10.6.5)的正确路径,至少是这样。 You may very well have set up the path to the framework correctly in your Xcode project. 您可能已经在Xcode项目中正确设置了框架的路径。

If I had to guess, I would say that when you experience this crash you are running it on a different version of Mac OS X, where the 2.6 version of the Python framework doesn't exist. 如果我不得不猜测,我会说当你遇到这次崩溃时,你会在不同版本的Mac OS X上运行它,其中2.6版本的Python框架不存在。 To explore the issue, try navigating into the Python framework and listing the versions available on the system on which you experience this error: 要探索此问题,请尝试导航到Python框架并列出您遇到此错误的系统上可用的版本:

cd /System/Library/Frameworks/Python.framework/Versions
ls -al

What output does that give? 这给了什么输出? I'm guessing it doesn't show a version 2.6 directory. 我猜它没有显示2.6版目录。 Which version of Mac OS X are you running this on? 您在运行此版本的Mac OS X? You may need to compile and link your application against an earlier version of the system in order to get it to run on whatever system you're seeing this error on. 您可能需要针对早期版本的系统编译和链接您的应用程序,以使其在您看到此错误的任何系统上运行。

XCode has so called SDKs which can be used to target earlier Max OS X versions from a recent one. XCode有所谓的SDK,可以用来定位最近的Max OS X版本。

Currently installed SDKs can be found in /Developer/SDKs. 目前安装的SDK可以在/ Developer / SDKs中找到。 Additional SDKs may be installed from an XCode DVD. 可以从XCode DVD安装其他SDK。

In a project created with XCode, SDK can be selected the following way. 在使用XCode创建的项目中,可以通过以下方式选择SDK。 Open Get info of a target, find Base SDK setting inside the Architectures section. 打开获取目标信息,在“架构”部分中找到“基本SDK”设置。 Select SDK you need and rebuild. 选择您需要的SDK并重建。

For example, Mac OS X 10.5 SDK contains Python versions 2.5 and 2.3 and the Current version points to 2.5. 例如,Mac OS X 10.5 SDK包含Python版本2.5和2.3,当前版本指向2.5。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM