conflicting types for xx错误
来源:互联网 发布:mfc编程实例 pdf 编辑:程序博客网 时间:2024/05/29 13:57
编译libvmi 0.8版本时,出现以下错误:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -fvisibility=hidden -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT libvmi_la-pretty_print.lo -MD -MP -MF .deps/libvmi_la-pretty_print.Tpo -c pretty_print.c -fPIC -DPIC -o .libs/libvmi_la-pretty_print.o
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.
原因二:
头文件的被循环引用,在引用时考虑清楚包含顺序
原因三:
头文件声明和定义参数稍有不同
例:
这是就会发生conflicting types for 错误问题
0 0
- conflicting types for xx错误
- conflicting types for xx错误
- conflicting types for xx错误
- conflicting types for xx错误
- conflicting types for xx错误(转)
- C语言“conflicting types for ...” 错误
- 关于错误提示conflicting types for "XXX"
- conflicting types for 'wchar_t'
- conflicting types for ...
- conflicting types for。。。。。。
- 关于“error: conflicting types for 'function'”编译错误的分析
- Spec2006 编译错误 md5sum.c: conflicting types for 'getline'
- 关于”error conflicting types for function”编译错误的分析
- error:conflicting types for 'function name'错误原因
- 编译时提示 conflicting types for 错误的解决办法
- error: conflicting types for ‘getline’
- error: conflicting types for 'XXXX'
- error: conflicting types for 'XXXX'
- 如何利用百度旗下的产品做网站推广优化。
- 没有永远的敌人,谷歌Chrome主页改为必应
- 逐行读取文本文件的 shell 脚本
- 发服务器不得不说的技术--sendfile
- 悲剧传奇
- conflicting types for xx错误
- CString转int
- datastation
- 【STL】插入型迭代器(Insert Iterator)或插入器(inserter)
- Cocos2D-X2.2.3学习笔记3(内存管理)
- MapReduce原理浅析(转)
- CodeIgniter 2.1.4 model 得不到数据库数据 model db 类无 result_array()方法
- 捕获Entity framework验证异常
- Lua的upvalue和闭包