”No previous prototype for function “warning警告错误
2012-08-02 10:28
441 查看
在编译《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
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
相关文章推荐
- c语言报错-- no previous prototype for function
- XCode 解决"No previous prototype for function"
- \"No previous prototype for function\" warning警告错误
- "No previous prototype for function" warning警告错误解决
- "No previous prototype for function" warning警告错误
- "No previous prototype for function" warning警告错误解决
- 消除编译告警——warning: no previous prototype for
- include/stdio.h:373: error: no previous prototype for 'getc'
- no matching function for call to ‘std::basic_string<char>::assign(std::string&, int)
- C++中错误no matching function for call to transform
- 【C++错误处理】no matching function for call to transform
- C++常见错误之:no matching function for call to transfor
- cocos2d-2.1beta3-x-2.1.1 "no matching function for call to..."
- no matching function for call to "namespace::class1::foo(class2&)"
- no matching function for call to 'sort(...),
- error: no matching function for call to 'std::exception:exception(const char[16])'
- C++常见错误之:no matching function for call to transform
- C++异常:no matching function for call to "Matrix(Matrix&)"
- error: no matching function for call to 'std::basic_ifstream<char>::open(std::string&)
- no matching function for call to ‘transform