无法在xcode 4.2上构build我的项目

我已经升级了我的xcode到4.2(使用雪豹)。以前我使用Xcode 3.2.6和我的项目成功与它。 现在我无法构build它,而是Xcode发出以下错误

ld: warning: option -A is obsolete and being ignored ld: entry point (start) undefined. Usually in crt1.o for architecture armv7 Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1 

该错误似乎是一些编译器错误,但无法弄清楚:(我google了,但没有运气,请build议一些解决scheme。

它看起来像链接器正在寻找一个启动函数作为入口点在crt1,但没有find它。 你可以尝试添加一个链接器标志,

  -e symbol_name Specifies the entry point of a main executable. By default the entry name is "start" which is found in crt1.o which contains the glue code need to set up and call main(). 

从ld的手册页。

第一个错误意味着Xcode 4.2中的链接器(ld)遇到不再受支持的选项(-A)。

如果您不再需要在Xcode 3.2.6中构build相同的Xcode项目,那么

  1. 检查您的项目的生成设置,以确保您没有指定“-A” 生成设置的链接部分
  2. 点击“validation设置”button 在这里输入图像说明 以确定可能导致问题的任何其他项目设置。

你的第二个错误可能是由Xcode 4.2默认的armv7构build体系结构导致的,因为它是使用Xcode 3.2.6构build的。 如果您需要为armv6构build二进制文件,那么将其添加到您的构build体系结构列表中。

检查你是否使用下面的标志,它会导致错误-nostdlib-noconfig