日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

(转载)conflicting types for xx各种错误的总结

發(fā)布時間:2025/5/22 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 (转载)conflicting types for xx各种错误的总结 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

http://blog.sina.com.cn/s/blog_5420e000010185o2.html

編譯libvmi 0.8版本時,出現(xiàn)以下錯誤:

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) 中的數(shù)據(jù)類型改為一致的即可。 見其論壇: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

?

原因一:
原來是因為沒有先做函數(shù)聲明,而函數(shù)位于main()之后。
在main函數(shù)前聲明了函數(shù)原型后,一切ok.

?

原因二:

頭文件的被循環(huán)引用,在引用時考慮清楚包含順序

?

原因三:

頭文件聲明和定義參數(shù)稍有不同

例:

?頭文件中聲明 void?Hanlder(const char * buf);

?在定義時寫作 void?Hanlder(char * buf);

這是就會發(fā)生conflicting types for 錯誤問題

分享:????

3

轉(zhuǎn)載于:https://www.cnblogs.com/zhugeruiyu/p/3615215.html

總結(jié)

以上是生活随笔為你收集整理的(转载)conflicting types for xx各种错误的总结的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。