#include "stdafx.h"
char     global_data[1024];

解决方案 »

  1.   

    在应用的实现文件中,最好在“BEGIN_MESSAGE_MAP”之前
      

  2.   

    在cpp文件中,写在函数的外面。
      

  3.   

    在变量前加 static 关键字就可以了
      

  4.   

    找到theApp的定义处,在那儿定义吧。一般还可以。
      

  5.   

    在cpp文件中,写在函数的外面。调用它的函数的前面。
      

  6.   

    在某个 .cpp 文件中加int g_Global ;在某个 .h 文件中加extern int g_Global ;然后所有的 .cpp 文件 include 那个 .h 文件,那么所有的 .cpp 文件就都能访问那个 g_Global 了。