iPhone应用程序上的Xcode链接器错误(仅在模拟器上) [英] Xcode linker error on iPhone app (Only on simulator)

查看:306
本文介绍了iPhone应用程序上的Xcode链接器错误(仅在模拟器上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个链接器错误,不会让我编译。它只发生在模拟器上。



Im getting this linker error that won't let me compile. It only happens on the simulator.

要点:

- 只在模拟器中发生

- 与此问题类似,但是在我的.pbxproj文件中找不到FRAMEWORK_SEARCH_PATHS

- 虽然我的操作系统是10.6.2,但我必须构建目标1.5以避免其他链接器错误

- libxml2.dylib 必需并且在我的框架组中

- 其他引用的我从来没有听说过的库。

- 试图将框架中的其他库,没有解决。




KEY POINTS:
- Happens only in simulator
- Similar to THIS question, but found no FRAMEWORK_SEARCH_PATHS in my .pbxproj file
- Though my OS is 10.6.2, I had to build target 1.5 to avoid other linker errors
- libxml2.dylib IS required and is in my Frameworks group
- The other cited libraries I have never heard of.
- Tried bringing in those other Libs under frameworks, didn't solve.


Build SpaceTweet of project SpaceTweet with configuration Debug

Ld build/Debug-iphonesimulator/SpaceTweet.app/SpaceTweet normal i386
cd "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)"
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk "-L/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator" -L/Users/Scott/Desktop "-L/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/../../libYAJLIPhone-0" -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib -L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk/usr/lib -L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib "-F/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator" -filelist "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/SpaceTweet.build/Debug-iphonesimulator/SpaceTweet.build/Objects-normal/i386/SpaceTweet.LinkFileList" -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -framework AVFoundation -framework MessageUI -lYAJLIPhone -lxml2 -o "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator/SpaceTweet.app/SpaceTweet"

ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libxml2.dylib, missing required architecture i386 in file
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libSystem.dylib, missing required architecture i386 in file
ld: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libobjc.A.dylib, missing required architecture i386 in file
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1






CLUE:

类似于此解决问题,但在我的情况下,我在我的项目包中的.pbxproj文件中找不到FRAMEWORK_SEARCH_PATHS条目,因此无法以解决问题的方式解决。

CLUE:
Again, MY question is very similar to THIS SOLVED QUESTION except that in my case I did NOT find a FRAMEWORK_SEARCH_PATHS entry in the .pbxproj file in my project bundle and thus could not solve in the manner in which that question was solved.

推荐答案

问题是这样的:

-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib 

这告诉你的模拟器(i386) (arm)/ usr / lib。

That's telling your Simulator (i386) build to use files from the Device (arm) /usr/lib.

在目标中查找/ usr / lib是(仅使用目标的获取信息/构建设置选项卡中的搜索泡泡)删除它。如果没有被告知使用错误的一个,编译器将使用正确的平台的usr / lib。

Find in your target where /usr/lib is (just use the Search bubble in the target's Get Info / Build Settings tab) and delete it. The compiler will use the correct platform's usr/lib if it's not told to use the wrong one first.

这篇关于iPhone应用程序上的Xcode链接器错误(仅在模拟器上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆