Implicit declaration of function 'ether_ntoa' is invalid in C99
报错代码:
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的更多相关文章
- Implicit declaration of function 'CC_MD5' is invalid in C99
//导入这个就行了#import <CommonCrypto/CommonDigest.h> //没有导包的时候,提示如下: Implicit declaration of functio ...
- 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函数的结尾.就是说你的一些 ...
- 关于"implicit declaration of function 'gettimeofday' is invalid in c99"的解决
http://blog.csdn.net/macmini/article/details/10503799 当我们使用 gettimeofday(&time, NULL);时,会出现这样一个W ...
- implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99
问题:implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in c99 解决办法: 在出现该问题的函数前后加上 ...
- Implicit declaration of function 'BMKCoordinateForMapPoint' is invalid in C99
少一个头文件 #import <BaiduMapAPI_Utils/BMKGeometry.h> 加上这个就好了 <HPHalfScreenTopBar: 0x103570bb0; ...
- Xcode解决“Implicit declaration of function 'XXX' is invalid in C99” 警告或报错
1.Build Setting>>>C Language Dialect,然后选择GNU99[-std=gnu99] (选择看项目实际要求). 2.Build Setting> ...
- xCode中去除“Implicit declaration of function 'sysctl' is invalid in C99” 警告
http://blog.csdn.net/dreambegin/article/details/8609121 一般出现该问题是因为通过C调用了unix/linux 底层接口,所以需要调整c语言的编译 ...
- 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下的代码如下: ...
- implicit declaration of function 'copy_from_user'
内核中使用copy_from_user()和copy_to_user()函数,编译出现错误: implicit declaration of function 'copy_from_user' 需要添 ...
随机推荐
- Qt Creator : Read an image from resources
最近两周碰到的一个问题是: opencv无法读取qt中的资源文件. 参考网址:https://stackoverflow.com/questions/45233559/qt-creator-read- ...
- PHP如何实现第三方分享
<!doctype html> <html> <head> <meta charset="UTF-8"> <title> ...
- CyclicBarrier和CountDownLatch的使用
CyclicBarrier: api对CyclicBarrier的描述: 一个同步辅助类,它允许一组线程互相等待,直到到达某个公共屏障点 (common barrier point).在涉及一组固定大 ...
- Java分布式数据导出实践
伴随业务发展日益剧增,对数据的要求越来越多也越来越高. 用户在浏览器发起导出请求--web服务器接收请求--请求后台获取数据--数据统计后生成excel或其他图标--响应给客户端 整个过程至少5步,才 ...
- Android使用adb命令查看CPU信息
Android中使用JNI编程的时候会需要编译出不同的SO文件,以供适配不同的机型. 例如: 由此需要查看不同机型的CPU信息. 使用ADB命令查看CPU信息命令如下: 1. adb shell 2. ...
- 虚拟机——vmtools安装出现Detected GCC binary at usr.bin.gcc.
在安装VMWare Tools遇到过这样一个问题 Searching for GCC... Detected GCC binary at "/usr/bin/gcc". The p ...
- 2017-7-18-每日博客-关于Linux下的通配符.doc
*:匹配零个或多个字符 ?:匹配任意单个字符 ~:当前用户家目录 ~username:用户家目录 ~+:当前工作目录 ~-:上一个工作目录 [0-9]:匹配任意数字范围 [a-z]:匹配任意小写字母( ...
- linux -特殊符号
在shell中常用的特殊符号罗列如下: # ; ;; . , / \\ 'string'| ! $ ${} $? $$ $* \"string\"* ** ...
- XmlSerializer使用
XmlSerializer是对xml进行序列化操作的对象.写了一个Order的序列化方法供留念. 序列化针对有get,set的属性:属性必须是public方式:对象顺序和序列化的顺序一致. 对象定义 ...
- 转 DNS原理及其解析过程【精彩剖析】
DNS原理及其解析过程[精彩剖析] http://369369.blog.51cto.com/319630/812889/ DNS原理及其解析过程 精彩剖析 网络通讯大部分是基于T ...