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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

conflicting types for xx错误

發布時間:2025/3/20 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 conflicting types for xx错误 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
編譯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.

?

原因二:

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

?

原因三:

頭文件聲明和定義參數稍有不同

例:

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

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

這是就會發生conflicting types for 錯誤問題

轉載于:https://www.cnblogs.com/zsw-1993/p/4879386.html

總結

以上是生活随笔為你收集整理的conflicting types for xx错误的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。