关于extern的用法
我做了一个c51程序,分三个文件main.c,ic.c,ic.hic.c中定义了两个函数
ic.h中声明了这两个函数
#ifndef _IC_H_
#define _IC_H_
其余省略
extern void displayflash();
extern void keypress();
#endif
main.c中包含了ic.h
可为什么在main(){}中调用displayflash();和keypress();
编译还是会有警告?
Build target 'Target 1'
compiling main.c...
linking...
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?CO?MAIN
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: DISPLAYFLASH
MODULE: main.obj (MAIN)
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: KEYPRESS
MODULE: main.obj (MAIN)
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: KEYPRESS
MODULE: main.obj (MAIN)
ADDRESS: 0021H
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: DISPLAYFLASH
MODULE: main.obj (MAIN)
ADDRESS: 0024H
Program Size: data=13.0 xdata=0 code=40
creating hex file from "template"...
"template" - 0 Error(s), 5 Warning(s).