简体   繁体   中英

Not able to build my project on xcode 4.2

I have upgraded my xcode to 4.2 (using snow leopard).Previously i was using Xcode 3.2.6 and my project build successfully with it. Now I'm unable to build it, instead Xcode emits the following error

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

The error seems to be some compiler error but can't figure it out .:( I googled for it but no luck yet. Please suggest some solution.

检查您是否正在使用以下标志,它将导致该错误-nostdlib-noconfig

我可以通过更新项目目标>构建设置中的“ iOS开发目标”来解决此问题

It looks like linker is looking for a start function as entry point in crt1, but didn't find it. You can try adding a linker flag,

  -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(). 

from the man page of ld.

The first error means the linker (ld) in Xcode 4.2 encountered an option (-A) that is no longer supported.

If you no longer need to build the same Xcode project in Xcode 3.2.6 then

  1. check your Project's Build Settings to ensure you don't have '-A' specified 构建设置的链接部分 .
  2. click on the "Validate Settings" button 在此处输入图片说明 to identify any other project settings that may cause problem.

Your second error may be caused by Xcode 4.2 defaulting to armv7 build architecture that is unlisted your Xcode project (because it was built using Xcode 3.2.6). If you need to build binaries for armv6, then add that to your build architecture list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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