报错代码:
strcpy(temp, (char *)ether_ntoa(LLADDR(sdl))); 解决方法: 导入这三个头文件即可,
#include <sys/types.h>
#include <sys/socket.h>
#include <net/ethernet.h> 然后上面那行代码会有一个警告:"Incompatible pointer types passing 'caddr_t' (aka 'char *') to parameter of type 'const struct ether_addr *'" ;
可以在LLADDR的前面加上(const struct ether_addr *) 也就是这样:
strcpy(temp, (char *)ether_ntoa((const struct ether_addr *)LLADDR(sdl)));
这样就没有警告了。

Implicit declaration of function 'ether_ntoa' is invalid in C99的更多相关文章

  1. Implicit declaration of function 'CC_MD5' is invalid in C99

    //导入这个就行了#import <CommonCrypto/CommonDigest.h> //没有导包的时候,提示如下: Implicit declaration of functio ...

  2. warning: control reaches end of non-void function 和 warning: implicit declaration of function 'rsgClearColor' is invalid in C99

    用gcc编译一个程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一些 ...

  3. 关于"implicit declaration of function 'gettimeofday' is invalid in c99"的解决

    http://blog.csdn.net/macmini/article/details/10503799 当我们使用 gettimeofday(&time, NULL);时,会出现这样一个W ...

  4. implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99

    问题:implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99 解决办法: 在出现该问题的函数前后加上 ...

  5. Implicit declaration of function 'BMKCoordinateForMapPoint' is invalid in C99

    少一个头文件  #import <BaiduMapAPI_Utils/BMKGeometry.h> 加上这个就好了 <HPHalfScreenTopBar: 0x103570bb0; ...

  6. Xcode解决“Implicit declaration of function 'XXX' is invalid in C99” 警告或报错

    1.Build Setting>>>C Language Dialect,然后选择GNU99[-std=gnu99] (选择看项目实际要求). 2.Build Setting> ...

  7. xCode中去除“Implicit declaration of function 'sysctl' is invalid in C99” 警告

    http://blog.csdn.net/dreambegin/article/details/8609121 一般出现该问题是因为通过C调用了unix/linux 底层接口,所以需要调整c语言的编译 ...

  8. linux系统下,警告:warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 和 warning: the `gets' function is dangerous and should not be used. 的由来和解决方法。

    字符数组 的英文名字是 char [] gets()函数的基本用法为:char *gets(char *s); 该函数的参数是一个字符数组,该函数的返回值也是一个字符数组. linux下的代码如下: ...

  9. implicit declaration of function 'copy_from_user'

    内核中使用copy_from_user()和copy_to_user()函数,编译出现错误: implicit declaration of function 'copy_from_user' 需要添 ...

随机推荐

  1. (原) Unreal创建自定义MeshCompoent

    @author:白袍小道 随缘查看 前言: 绘制相关类 MeshCompoent 模型组件 FVertexBuffer 顶点缓冲区封装 FIndexBuffer 顶点索引缓冲区封装 FRHIResou ...

  2. parameter localparam define的区别

    `define 语法格式 `define A 12 //注意不加:不能忘记" ` " 作用区域 在整个工程中均有效,因为它是可以跨模块的定义 parameter 和 localpa ...

  3. shell之ip命令

    转:出处我也不知道了,学习时候记下的笔记 1.作用 ip是iproute2软件包里面的一个强大的网络配置工具,它能够替代一些传统的网络管理工具,例如ifconfig.route等,使用权限为超级用户. ...

  4. Linq学习(一)

    与LINQ有关的语言特性 1.隐式类型 var 2.匿名类型 如:var obj = new {Guid.Empty, myTitle = "匿名类型", myOtherParam ...

  5. nginx教程全集汇总

    Nginx基础1.  nginx安装:httpwww.ttlsa.comnginxnginx-install-on-linux2.  nginx 编译参数详解(运维不得不看):http://www.t ...

  6. 【GXZ的原创】平衡树性能测试

    本文作者为 GXZlegend ,转载请注明 出处 ,谢谢! 〇.序言 前些日子闲的蛋疼做了个平衡树性能测试... 主要是因为学会的平衡树越来越多,做题时却不知道写哪个... 本想结合效率和代码复杂度 ...

  7. 【bzoj3831】[Poi2014]Little Bird 单调队列优化dp

    原文地址:http://www.cnblogs.com/GXZlegend/p/6826475.html 题目描述 In the Byteotian Line Forest there are   t ...

  8. Spring bean 创建过程源码解析

    在上一篇文件 Spring 中 bean 注册的源码解析 中分析了 Spring 中 bean 的注册过程,就是把配置文件中配置的 bean 的信息加载到内存中,以 BeanDefinition 对象 ...

  9. 【Error】Python:UnicodeDecodeError: ‘XXX' codec can't decode bytes in position... 解决方法

    错误信息: UnicodeDecodeError: ‘XXX' codec can't decode bytes in position 2-5: illegal multibyte sequence ...

  10. 汕头市队赛SRM15

    T1——czl SRM 15 众所周知,czl家养了一只可♂爱的***(已屏蔽),那只东西很贪吃,所以czl家很多零食仓库,然而这些仓库里有很多老鼠. 为了心爱的***,czl决定点燃纯艾条,用烟熏老 ...