报错--01

1.  address family not support by protocol    添加这一句:serveraddr.sin_family = AF_INET; UDP协议 sendto 和 recvfrom 浅析与示例 

2.  编译出错

把 #include <./include2/test27.hpp> 改为  #include "./include2/test27.hpp"   就可以了。

#include<>直接从编译器自带的函数库中寻找文件,#include""是先从自定义的文件中找 ,如果找不到在从函数库中寻找文件。

3. 应输入“;”C/ 

我一定义函数就报这个错误,后来发现,我在函数内部,定义函数了。

4. 用libpcap编写抓包程序编译时候出错: 错误信息:/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语言多文件编程,即main文件调用其他.c文件的方法_脱去三千烦恼丝-CSDN博客_c语言程序调用外部文件

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);  这样写不报错了。

7. recvfrom bad address 

recvfrom: Bad address_小易-CSDN博客

主要在于最后一个参数的格式: 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博客

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值