warning: implicit declaration of function导致core
来源:互联网 发布:旅游产品网络营销策划 编辑:程序博客网 时间:2024/05/18 01:47
centos上使用gcc编译某程序得到warning:
implicit declaration of function
同时写了一个测试程序用到c++库, 因此使用g++编译。
测试程序无问题。 原程序使用gcc编译得到warning没在意, 使用起来后一直莫名其妙的core掉。 开始以为是其他问题而忽略了该warning。 而该core恰恰是由此warning产生的。
因为用到了 strcasestr, 需要
#define _GNU_SOURCE //这个可能多余、在网上查到的
#define __USE_GNU //这个必需。 见系统的 include/相应的文件下。
#include <string.h> //声明该函数的头文件
__USE_GNU 没有定义该宏时就会产生上述warning、 gcc会core。 定义之后就无问题了。
同时发现gcc中 min也未定义。。
- warning: implicit declaration of function导致core
- 关于 warning: implicit declaration of function ‘****’
- implicit declaration of function '...' 的warning
- warning: implicit declaration of function ‘inet_ntop’解决办法
- implicit declaration of function XXXXXXX 的warning
- warning: implicit declaration of function 与c99
- 嵌入式 warning: implicit declaration of function 'xxx'
- warning:implicit declaration of function 'free'
- 解决warning:implicit declaration of function 'Xil_Out32' [-Wimplicit-function-declaration]
- implicit declaration of function
- implicit declaration of function
- implicit declaration of function
- warning incompatible implicit declaration of built-in function 'printf'
- gcc编译出现“warning: implicit declaration of function ‘inet_aton’”
- warning: incompatible implicit declaration of built-in function ***
- gcc warning: incompatible implicit declaration of built-in function
- warning:incompatible implicit declaration of built-in function
- warning: incompatible implicit declaration of built-in function ‘xyz’
- Silverlight 安全性错误
- 远程桌面连接 终端服务器超出最大允许连接数,默认只能连接两个用户,超出最大允许连接数,增加最大允许连接数,修改最大连接数
- temp存储
- 纯资源(.rc)DLL创建与使用
- Qt学习笔记,Qt国际化
- warning: implicit declaration of function导致core
- 构建完整的企业信息安全体系
- Android中的Intent详细讲解
- Apache配置中ProxyPassReverse指令的含义
- Android AudioManager控制系统声音的流程 zt
- Groupon重启IPO,可能于十月底或十一月初上市
- 导excel数据到word模板
- 随处使用Cocoa文字系统
- DFD图