美文网首页
"No previous prototype for

"No previous prototype for

作者: 星火燎原 | 来源:发表于2018-05-24 10:43 被阅读9次

(转自:http://blog.sina.com.cn/s/blog_af73e7a70101bh4m.html,感谢作者)
在编译《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

相关文章

网友评论

      本文标题:"No previous prototype for

      本文链接:https://www.haomeiwen.com/subject/zoijjftx.html