Chinaunix首页 | 论坛 | 博客
  • 博客访问: 697476
  • 博文数量: 260
  • 博客积分: 7033
  • 博客等级: 少将
  • 技术积分: 2633
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-13 23:15
文章分类

全部博文(260)

文章存档

2012年(2)

2011年(41)

2010年(78)

2009年(139)

我的朋友

分类: 嵌入式

2010-11-17 23:53:56

某平台项目,同时支持3.x以及4.x iPhone OS,在Xcode 3.2.4下可以编译成功的程序,在Xcode 3.1.4下编译报错: syntax error before "AT_NAME" token

解决方法:
I've traced this problem to be the compiler version being used. From what I can tell, [REDACTED] requires GCC 4.2 while iPhone SDK 2.x only works with GCC 4.0.

Here's a way to fix this.

In your Target Info, select Build separator and look for the section Compiler Version. Then:

Select the C/C++ Compiler Version row
Set the default to GCC 4.0
At the bottom-left control, hit Add Build Setting Condition
On the left, choose Device - iPhone OS 3.0
On the right, chose GCC 4.2

Repeat steps 3 to 5, now with Simulator - iPhone OS 3.0 on step 4.


或者其它的解决 方法

The problem comes from SDK 3.0 which now use gcc 4.2 but scan-build still use /usr/bin/gcc. So you need to tell scan-build to use /usr/bin/gcc-4.2 instead.

scan-build --use-cc=/usr/bin/gcc-4.2 xcodebuild -configuration Debug

阅读(593) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~