|
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: USB_INT_ENABLE
MODULE: D:\F320\NPTF320.obj (NPTF320)
ADDRESS: 0036H
二楼说的没错 就是在那找不到变量
解决办法:extern +类型+变量 在头文件中声明外部变量
如果是自己定义的类型如
typedef unsigned char U8; /* defined for unsigned 8-bits integer variable 无符号8位整型变量 */
typedef signed char S8; /* defined for signed 8-bits integer variable 有符号8位整型变量 */
typedef unsigned int U16; /* defined for unsigned 16-bits integer variable 无符号16位整型变量 */
typedef signed int S16; /* defined for signed 16-bits integer variable 有符号16位整型变量 */
typedef unsigned long U32; /* defined for unsigned 32-bits integer variable 无符号32位整型变量 */
typedef signed long S32; /* defined for signed 32-bits integer variable 有符号32位整型变量 */
typedef float F32; /* single precision floating point variable (32bits) 单精度浮点数(32位长度) */
typedef double F64; /* double precision floating point variable (64bits) 双精度浮点数(64位长度) */
除了在头文件中作出声明外
//----------------------------------------------//
//----------------定义区--------------------//
//----------------------------------------------//
extern U8 U8FLAG,k;
extern U8 U8count,U8temp;
extern U8 U8T_data_H,U8T_data_L,U8RH_data_H,U8RH_data_L,U8checkdata;
extern U8 U8T_data_H_temp,U8T_data_L_temp,U8RH_data_H_temp,U8RH_data_L_temp,U8checkdata_temp;
extern U8 U8comdata;
extern U8 count;
extern U16 U16temp1,U16temp2;
还需要在.c中声明
#include "AM2302.h"
U8 U8FLAG,k;
U8 U8count,U8temp;
U8 U8T_data_H,U8T_data_L,U8RH_data_H,U8RH_data_L,U8checkdata;
U8
U8T_data_H_temp,U8T_data_L_temp,U8RH_data_H_temp,U8RH_data_L_temp,U8checkdata_temp;
U8 U8comdata;
U8 count;
U16 U16temp1,U16temp2; |
|