奇怪为什么我定义的全局变量在其他cpp中不能用?
ta 2000-06-20 01:23:00 assumed 1 as below:
a.h
a.cpp
HWND hWnda;
using hwnda here, no errors are occured here.
b.h
b.cpp
#incluse "a.h"
#include "b.h"
//using hWnda here
the compiler said hWnda undeclare identifier.
assumed 1 as below:
a.h
#ifndef myhwnd
#define myhwnd
HWND hWnda;
#endif
a.cpp
include "a.h"
using hWnda
b.h
b.cpp
#include "a.h"
using hWnda
than the linker said when link b.h:
hWnda has rlready declared in a.obj
Please, Please, give me a point, What's wrong here?