本文介绍了什么导致在Mac OS X上没有合适的图像找到错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照Chris Hanson关于在Xcode 3.1中调试框架单元测试的,但是当尝试运行自定义可执行文件,程序崩溃,说明以下错误消息[为代码$(BUILD_PRODUCTS_DIR)的实际位置的构建产品]。

I followed Chris Hanson's advice about debugging framework unit tests in Xcode 3.1, but when trying to run the custom executable, the program crashes, stating the below error message [substituted $(BUILD_PRODUCTS_DIR) for the real location of the build products].

2009-03-02 19:56:03.414 otest[28059:10b] Error loading
    $(BUILD_PRODUCTS_DIR)/Debug/Unit Tests.octest/
    Contents/MacOS/Unit Tests: dlopen($(BUILD_PRODUCTS_DIR_)/Unit
    Tests.octest/Contents/MacOS/Unit Tests, 265):
    no suitable image found. Did find:
    $(BUILD_PRODUCTS_DIR)/Unit Tests.octest/Contents/MacOS/Unit Tests:
    mach-o, but wrong architecture
2009-03-02 19:56:03.561 otest[28059:10b] The test bundle at
    $(BUILD_PRODUCTS_DIR)/Unit Tests.octest could not be loaded because
    it is built for a different architecture than the currently-running
    test rig (which is running as unknown).
2009-03-02 19:56:03.568 otest[28060:203] *** NSTask: Task create for path
    '$(BUILD_PRODUCTS_DIR)/Unit Tests.octest/Contents/MacOS/Unit Tests'
    failed: 8, "Exec format error". Terminating temporary process.

我的问题是,什么导致找不到合适的图片。找到:... 错误消息,以及如何让 otest 可执行文件正确运行,以便我可以调试我的框架单元测试?

My question is, what leads to the no suitable image found. Did find: ... error message and how can I get the otest executable to run correctly so that I can debug my framework unit tests?

有一个更简单的方法来做这个使用otest?

Is there an easier way to do this with out using otest?

推荐答案

otest运行正常。该错误告诉您,它无法加载测试包,并且它无法加载测试包的原因是因为它不知道它运行的是什么架构。

otest is running just fine. The error is telling you that it can't load the test bundle, and that the reason why it can't load the test bundle is because it doesn't know what architecture it's running as.

解决方案是在otest环境中设置 ARCHPREFERENCE 。你可以在Xcode的自定义可执行编辑器中做到这一点。将其设置为要在其下运行测试的体系结构。

The solution is to set ARCHPREFERENCE in otest's environment. You can do this in Xcode's custom executable editor. Set it to the architecture you want to run tests under.

这篇关于什么导致在Mac OS X上没有合适的图像找到错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 11:41