关于 implicit declaration of function --Which should not record for myself
2011-10-08 15:50
417 查看
用gcc编译c程序的时候 经常会出现
implicit declaration of function '...' 的warning
偶经过这几天的经验,发现主要有2种情况会产生这种warning
1 没有把函数所在的c文件生成.o目标文件
2 在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明
第二种情况如此:
camif_fsm.c中的函数定义:
void camif_start_c_with_p(camif_cfg_t *cfg, camif_cfg_t *other)
{
// cfg->gc->other = get_camif(CODEC_MINOR);
cfg->gc->other = other;
camif_start_p_with_c(cfg);
}
该函数的声明未包含在camif.h文件中,这样在调用此函数时由于camif_start_p_with_c(cfg)函数的定义在此函数之前,故产生此错误:warning: implicit declaration of function `camif_start_c_with_p'
So the problem is the include file should exist in .c and .h files...
implicit declaration of function '...' 的warning
偶经过这几天的经验,发现主要有2种情况会产生这种warning
1 没有把函数所在的c文件生成.o目标文件
2 在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明
第二种情况如此:
camif_fsm.c中的函数定义:
void camif_start_c_with_p(camif_cfg_t *cfg, camif_cfg_t *other)
{
// cfg->gc->other = get_camif(CODEC_MINOR);
cfg->gc->other = other;
camif_start_p_with_c(cfg);
}
该函数的声明未包含在camif.h文件中,这样在调用此函数时由于camif_start_p_with_c(cfg)函数的定义在此函数之前,故产生此错误:warning: implicit declaration of function `camif_start_c_with_p'
So the problem is the include file should exist in .c and .h files...
相关文章推荐
- 关于 implicit declaration of function --Which should not record for myself
- C语言问题 关于implicit declaration of function
- 一些关于ARM驱动的问题 make menuconfig && implicit declaration of function
- 关于 implicit declaration of function 一点经验之谈
- Implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in C99
- 报错:Implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in C99
- Implicit declaration of function 'NSFileTypeForHFSTypeCode' is invalid in C99
- C系列: 关于implicit declaration of function的warning
- 关于Xcode6编译变更 “Implicit declaration of function 'sysctl' is invalid in C99” 报错问题
- 关于"implicit declaration of function 'gettimeofday' is invalid in c99"的解决
- 关于 implicit declaration of function 一点经验之谈
- [解决]Hive执行语句:Unable to create temp file for insert values Expression of type TOK_FUNCTION not suppor
- yaffs linux 3.11 编译时报错 implicit declaration of function 'create_proc_entry'
- implicit declaration of function 'KBUILD_STR' 错误
- (NOT CLEAR)Question 21: Which of the following statements provide a valid reason not to use RTTI for distributed (i.e. networked
- implicit declaration of function 's3c2410_gpio_cfgpin"的解决办法
- 编译时报警 implicit declaration of function
- error:implicit declaration of function 'kmalloc'
- warning: implicit declaration of function导致core
- 关于vaule of ESP was not properly saved across a function call 错误