报错--01
1.??address family not support by protocol? ? 添加這一句:serveraddr.sin_family = AF_INET;?UDP協(xié)議 sendto 和 recvfrom 淺析與示例?
2.? 編譯出錯(cuò)
把 #include <./include2/test27.hpp>?改為? #include?"./include2/test27.hpp"? ?就可以了。
#include<>直接從編譯器自帶的函數(shù)庫(kù)中尋找文件,#include""是先從自定義的文件中找 ,如果找不到在從函數(shù)庫(kù)中尋找文件。
3.?應(yīng)輸入“;”C/?
我一定義函數(shù)就報(bào)這個(gè)錯(cuò)誤,后來(lái)發(fā)現(xiàn),我在函數(shù)內(nèi)部,定義函數(shù)了。
4.?用libpcap編寫(xiě)抓包程序編譯時(shí)候出錯(cuò): 錯(cuò)誤信息:/tmp/ccoIJ1wR.o(.text+0x2ae): In function 'main'::_百度知道 (baidu.com)
/usr/bin/ld: /tmp/ccqummkU.o: in function `main':
main.c:(.text+0x14): undefined reference to `test01'
collect2: error: ld returned 1 exit status
c語(yǔ)言多文件編程,即main文件調(diào)用其他.c文件的方法_脫去三千煩惱絲-CSDN博客_c語(yǔ)言程序調(diào)用外部文件
5.?warning: implicit declaration of function ‘test01_02’; did you mean ‘test02’? [-Wimplicit-function-declaration]
隱形聲明警告解決//warning: implicit declaration of function ‘XXX’; did you mean ‘YYY’?_ControlLearner的博客-CSDN博客
6.??warning: null argument where non-null required (argument 2) [-Wnonnull]
? ?30 | ? ? ? ? execl("child_process",NULL);
execl("child_process","?",NULL);? 這樣寫(xiě)不報(bào)錯(cuò)了。
7.?recvfrom bad address?
recvfrom: Bad address_小易-CSDN博客
主要在于最后一個(gè)參數(shù)的格式:?rev_len?=?recvfrom(sockfd,?buffer,?sizeof(buffer),?0,?(struct?sockaddr*)&servaddr,?(socklen_t*)&servaddr_len);
8.?warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]?
隱形聲明警告解決//warning: implicit declaration of function ‘XXX’; did you mean ‘YYY’?_ControlLearner的博客-CSDN博客
?
總結(jié)
- 上一篇: 将labelme生成的json文件转换成
- 下一篇: 初中计算机教资考试知识点,2018(下)