在用到igobal的.cpp文件头加上extern int igobal;

解决方案 »

  1.   

    因为global.h被重复include了。
    在global.h的最前面加上:
    #ifndef _GLOBAL_H_
    #define _GLOBAL_H_
    在global.h的最后加上:
    #endif
      

  2.   

    我也试过了,#ifndef....
    ...
    #endif
    可是同样的错误,所以我很知道是为什么
      

  3.   

    .h文件种加
    #ifndef _GLOABLE_H_
    #define _GLOABLE_H_在.cpp文件种加入
    #include <stdafx.h>
      

  4.   

    // my.h
    #ifndef _MY_H_
    #define _MY_H_
    int globle = 0 ;
    void myfunc() ;
    #endif 
    //my.cpp
    #include <Stdafx.h>
    void myfunc()
    {
      AfxMessageBox( "sdff" ) ;
    }
    // mydlg.cpp
    #include "my.h"
      

  5.   

    不要#include "My_Gobal.h",直接加extern void myfunc().
    我试过了,OK!
      

  6.   

    上边这么多人说的都不行吗?按道理说,应该可以解决你的问题了,是不是其它方面引起的错误? 
    如果工程不大的话,发过来我给你试试!
    [email protected]