程序中如下在共享段中定义了一个变量dllCount:
#pragma data_seg("Shared")
int dllCount=0 ;
#pragma data_seg()
#pragma comment (linker,"/section:Shared,rws")
后面的函数中应用这个变量,但是变异时报错:error C2065: 'dllCount' : undeclared identifier
请各位大虾帮忙解决!
#pragma data_seg("Shared")
int dllCount=0 ;
#pragma data_seg()
#pragma comment (linker,"/section:Shared,rws")
后面的函数中应用这个变量,但是变异时报错:error C2065: 'dllCount' : undeclared identifier
请各位大虾帮忙解决!
“后面的函数"应用这个变量,按你的说法好象在同一个模块中访问。
int dllCount=33;
#pragma data_seg()
#pragma comment (linker,"/section:shared,rws")int main()
{
dllCount=44;
return 0;
}编译不会出现error C2065: 'dllCount' : undeclared identifier
不会出现这样的错啊?