conflicting types for xxxx错误 (转)
2015-06-01 18:02
525 查看
pretty_print.c:31: error: conflicting types for ‘vmi_print_hex’
libvmi.h:749: note: previous declaration of ‘vmi_print_hex’ was here
make[3]: *** [libvmi_la-pretty_print.lo] Fehler 1
make[3]: Leaving directory `/usr/local/src/libvmi-0.8/libvmi'
make[2]: *** [all-recursive] Fehler 1
make[2]: Leaving directory `/usr/local/src/libvmi-0.8/libvmi'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/usr/local/src/libvmi-0.8'
make: *** [all] Fehler 2
解决方案:
将libvmi/libvmi.h:void vmi_print_hex (unsigned char *data, unsigned long length);和
libvmi/pretty_print.c:void vmi_print_hex (unsigned char *data, size_t length)
中的数据类型改为一致的即可。
见其论坛:https://groups.google.com/forum/?fromgroups#!topic/vmitools/w76m93KevFg
常见此类问题的原因如下(引)
错误:
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 错误问题
libvmi.h:749: note: previous declaration of ‘vmi_print_hex’ was here
make[3]: *** [libvmi_la-pretty_print.lo] Fehler 1
make[3]: Leaving directory `/usr/local/src/libvmi-0.8/libvmi'
make[2]: *** [all-recursive] Fehler 1
make[2]: Leaving directory `/usr/local/src/libvmi-0.8/libvmi'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/usr/local/src/libvmi-0.8'
make: *** [all] Fehler 2
解决方案:
将libvmi/libvmi.h:void vmi_print_hex (unsigned char *data, unsigned long length);和
libvmi/pretty_print.c:void vmi_print_hex (unsigned char *data, size_t length)
中的数据类型改为一致的即可。
见其论坛:https://groups.google.com/forum/?fromgroups#!topic/vmitools/w76m93KevFg
常见此类问题的原因如下(引)
错误:
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 错误问题
相关文章推荐
- 比AtomicLong还高效的LongAdder 源码解析
- 类似a:hover的伪类的注解
- Java面试题-并发工具
- SSAS中CUBE行权限数据级权限控制
- 【云快讯】之四十四《IBM Watson在能源行业的新应用》
- 日期计算
- nginx探索--1
- Class not found when unmarshalling
- Java面试题-Java中的锁
- unity 角色死亡界面变灰实现
- 从ucOS谈,为什么需要操作系统?
- Linux安装ImageMagick与JMagick完成过程及配置
- php将字符串随机分割成不同长度数组的方法
- Curator框架
- 傅里叶变换、拉普拉斯变换、Z变换
- Libevent源码分析-----bufferevent工作流程探究
- ScrollView与ListView合用(正确计算Listview的高度)的问题解决
- Java面试题-并发容器和框架
- [Objective-C] 004_继承封装与多态
- 经典排序算法--插入排序