求救 C:\KYE.C(17): error C267: 多个文件调用一个数组的问题
C:\KYE.C(17): error C267: 'update_pca9635': requires ANSI-style prototype在main.c中的主函数外定义了一个数组。
unsigned char code ab[]={0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X01,0X01,0X01,0X00,0X01,0X01,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,······
void main(void)
{
init_pca9635();
pause();
update_pca9635(ab); 这里报C:\KYE.C(17): error C267
while(1);
}
===========================================================
update_pca9635(ab);定义在另一个c文件中 。并且这个文件使用了extern code ab[];
void update_pca9635(unsigned char pic[])
{
unsigned char n;
start_i2c();
SendByte_init(0xe0);
SendByte_init(0xa2);
SendByte_init(0x81);
SendByte_init(0x05);
for(n=0;n<201;n=n+8)
{
SendByte(pic,pic,pic,pic,pic,pic,pic,pic);
}
stop_i2c();
}
大侠们看看问题在哪里···
要是把代码写到一个c文件就不会报错
在线等那 extern code ab[]; 类型呢?
update_pca9635 函数有没有在main.c文件里声明? 回复【1楼】Pony279 Pony279
-----------------------------------------------------------------------
加了类型也通不过··
在h文件里面声明了。main.c 引用的h文件
、】 能不能把工程发上来? 回复【3楼】Pony279 Pony279
-----------------------------------------------------------------------
马上 点击此处下载 ourdev_721996KAJ99P.zip(文件大小:3K) (原文件名:timer0.zip) kye.c(5): warning C318: can't open file 'pca_9635.h'
#include "pca_9635.h"
实际头文件 pca9635.h
一个警告都不要放过。。。 、、??????看出问题了么? 你的kye.c里面#include <pca_9635.h>文件名不对。。。 额··真的对了呢···
大哥厉害··大哥你qq多少 我有问题 就好请教你
页:
[1]