`

conflicting types for

 
阅读更多

错误:
test.c:22: error: conflicting types for 'urlencode'
test.c:18: error: previous implicit declaration of 'urlencode' was here

 

原因一:
原来是因为没有先做函数声明,而函数位于main()之后。
在main函数前声明了函数原型后,一切ok.

 

原因二:

头文件的被循环引用,在引用时考虑清楚包含顺序

 

原因三:

头文件声明和定义参数稍有不同

例:

 头文件中声明 void Hanlder(const char * buf);

 在定义时写作 void Hanlder(char * buf);

这是就会发生conflicting types for 错误问题

 

大家编程多注意即可

部分来自:http://www.cnblogs.com/gudai/archive/2006/07/26/460133.html

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics