您的位置:首页 > 其它

"No previous prototype for function" warning警告错误

2011-11-13 21:07 453 查看
在编译《iphone开发秘籍》第八章的秘诀一的代码时碰到以下警告错误:

CGPoint randomPoint()
{
int half = 32;
int freesize = 240 - 2 * half;
return CGPointMake(random() % freesize + half, random() % freesize + half);
}

warning:No previous prototype for function "randomPoint"。如何取消这个警告错误呢?方法尝试了这两种都可以:

1.方法上加修饰符static

2.或者Project-Info -> TARGETS ->Build Settings -> LLVM GCC4.2 - Warnings组 -> Missing Function Prototypes Yes->No
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: