错误代码:
F:\backup\Zero\NoiseImg.cpp(133) : fatal error C1001: INTERNAL COMPILER ERROR
  (compiler file 'E:\8168\vc98\p2\src\P2\main.c', line 494)
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information出错函数:
CColor CNoiseImg::GetColor( float* pos ) 
{
     CColor result;
★  result.cR = math_absf( math_sinf( pos[0] * pos[1] * 50.0f ) );
     result.cG = result.cR;
     result.cB = math_absf( math_cosf( pos[0] * pos[1] * 40.0f ) );
     result.cA = result.cR;
     return result;
}
带星号的那行出错
//_________________________________math_absf()定义: in mathex.hinline float math_absf( float r ) 
{
*(long*)&r &= 0x7fffffff; // clear  31 bits
return r;
}math_sinf()定义:inline float math_sinf( float r ) 
{
__asm 
{
fld r
fsin
}
}//____________________________________这两个函数我在其它地方调用都没问题,而且以前就是一步一步在控制台下写出来的,都测试过,是正确的啊。又出错啊???何必呢???何苦呢,,,,还是100分,,,

解决方案 »

  1.   

    INTERNAL COMPILER ERROR
    (compiler file 'file', line number)This error is most often generated in one of two cases: Failure to recover the compiler's internal state following detection of a syntax error in the program. The first pass of the compiler will occasionally fail when attempting to recover its state following the detection of a malformed program. Typically, the compiler will have printed an error message (or messages) and will later produce an internal compiler error. In most cases, fixing the errors reported in your code and recompiling will solve the problem.
    Failure of the code generator to find a way to generate correct code for a construct. This is most often caused by the interaction of an expression and an optimization option. The optimization has generated a tree which the compiler does not know how to handle. Such a problem can often be fixed by removing one or more optimization options when compiling the particular function containing the line indicated in the error message. 
    If no error messages have been emitted prior to the internal compiler error, then the next step is to determine which pass of the compiler is emitting the internal compiler error. This can be determined by recompiling the application with the /Bd option included. The /Bd option will cause each pass to print its name and arguments when it is invoked. The last pass invoked before the error is emitted is the one responsible.If the pass indicated is P1, then the likely problem is still error recovery, as in number one above, but it is happening before the compiler has had a chance to emit the error message for the error it has just discovered. In such a case, examine the line on which the internal compiler error is reported. This line may also contain an unreported syntax error. Fixing any errors you find on that line will solve the internal compiler error in most cases. If you cannot find any error on that line or on the line previous to the one reported, contact Microsoft Product Support Services for help.If the pass indicated is P2, then the problem can usually be fixed by removing one or more optimization options (or using a different code generator). You can determine which option is at fault by removing them one at a time and recompiling until the message goes away. Generally the last one removed is the problem and all other optimizations can be used safely. The most common culprits are /Og, /Oi, and /Oa. Once the offending optimization is discovered, it need not be turned off for the entire compilation. The offending optimization can be disabled with the optimize pragma while compiling the function where the error occurred, but enabled for the rest of the module. More rarely, such errors occur at very low optimization levels or even when optimization is disabled. In such cases, rewriting the line where the error is reported (or possibly several lines including the one causing the error) may be a solution. If none of these options works, consult the technical support help file or the technical support section in one of your manuals.
      

  2.   

    我照着加了个/Bd参数,,,,结果出现了:
    Linking...
    ZGLext.obj : error LNK2005: "void (__stdcall* glUnlockArraysEXT)(void)" (?glUnlockArraysEXT@@3P6GXXZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glLockArraysEXT)(int,int)" (?glLockArraysEXT@@3P6GXHH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4svARB)(unsigned int,short const *)" (?glMultiTexCoord4svARB@@3P6GXIPBF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4sARB)(unsigned int,short,short,short,short)" (?glMultiTexCoord4sARB@@3P6GXIFFFF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4ivARB)(unsigned int,int const *)" (?glMultiTexCoord4ivARB@@3P6GXIPBH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4iARB)(unsigned int,int,int,int,int)" (?glMultiTexCoord4iARB@@3P6GXIHHHH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4fvARB)(unsigned int,float const *)" (?glMultiTexCoord4fvARB@@3P6GXIPBM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4fARB)(unsigned int,float,float,float,float)" (?glMultiTexCoord4fARB@@3P6GXIMMMM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4dvARB)(unsigned int,double const *)" (?glMultiTexCoord4dvARB@@3P6GXIPBN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord4dARB)(unsigned int,double,double,double,double)" (?glMultiTexCoord4dARB@@3P6GXINNNN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3svARB)(unsigned int,short const *)" (?glMultiTexCoord3svARB@@3P6GXIPBF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3sARB)(unsigned int,short,short,short)" (?glMultiTexCoord3sARB@@3P6GXIFFF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3ivARB)(unsigned int,int const *)" (?glMultiTexCoord3ivARB@@3P6GXIPBH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3iARB)(unsigned int,int,int,int)" (?glMultiTexCoord3iARB@@3P6GXIHHH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3fvARB)(unsigned int,float const *)" (?glMultiTexCoord3fvARB@@3P6GXIPBM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3fARB)(unsigned int,float,float,float)" (?glMultiTexCoord3fARB@@3P6GXIMMM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3dvARB)(unsigned int,double const *)" (?glMultiTexCoord3dvARB@@3P6GXIPBN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord3dARB)(unsigned int,double,double,double)" (?glMultiTexCoord3dARB@@3P6GXINNN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2svARB)(unsigned int,short const *)" (?glMultiTexCoord2svARB@@3P6GXIPBF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2sARB)(unsigned int,short,short)" (?glMultiTexCoord2sARB@@3P6GXIFF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2ivARB)(unsigned int,int const *)" (?glMultiTexCoord2ivARB@@3P6GXIPBH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2iARB)(unsigned int,int,int)" (?glMultiTexCoord2iARB@@3P6GXIHH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2fvARB)(unsigned int,float const *)" (?glMultiTexCoord2fvARB@@3P6GXIPBM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2fARB)(unsigned int,float,float)" (?glMultiTexCoord2fARB@@3P6GXIMM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2dvARB)(unsigned int,double const *)" (?glMultiTexCoord2dvARB@@3P6GXIPBN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord2dARB)(unsigned int,double,double)" (?glMultiTexCoord2dARB@@3P6GXINN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1svARB)(unsigned int,short const *)" (?glMultiTexCoord1svARB@@3P6GXIPBF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1sARB)(unsigned int,short)" (?glMultiTexCoord1sARB@@3P6GXIF@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1ivARB)(unsigned int,int const *)" (?glMultiTexCoord1ivARB@@3P6GXIPBH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1iARB)(unsigned int,int)" (?glMultiTexCoord1iARB@@3P6GXIH@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1fvARB)(unsigned int,float const *)" (?glMultiTexCoord1fvARB@@3P6GXIPBM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1fARB)(unsigned int,float)" (?glMultiTexCoord1fARB@@3P6GXIM@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1dvARB)(unsigned int,double const *)" (?glMultiTexCoord1dvARB@@3P6GXIPBN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1dARB)(unsigned int,double)" (?glMultiTexCoord1dARB@@3P6GXIN@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glClientActiveTextureARB)(unsigned int)" (?glClientActiveTextureARB@@3P6GXI@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "void (__stdcall* glActiveTextureARB)(unsigned int)" (?glActiveTextureARB@@3P6GXI@ZA) already defined in Texture.obj
    ZGLext.obj : error LNK2005: "class ZGLext  Zero_glext" (?Zero_glext@@3VZGLext@@A) already defined in Texture.obj
    Zero.exe : fatal error LNK1169: one or more multiply defined symbols found
      

  3.   

    我快晕死了,,,,我现在只不过是把以前写的一些代码修改了一下,,,,
    以前很少遇到LIN2005啊....
    ifndef __ZGLEXT_H__
    #define __ZGLEXT_H__
    #include "stdafx.h"
    #include "glext.h"//Fog
    // GL_ARB_multitexture
    extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
    extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
    extern PFNGLMULTITEXCOORD1DARBPROC glMultiTexCoord1dARB;
    extern PFNGLMULTITEXCOORD1DVARBPROC glMultiTexCoord1dvARB;
    extern PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB;
    extern PFNGLMULTITEXCOORD1FVARBPROC glMultiTexCoord1fvARB;
    extern PFNGLMULTITEXCOORD1IARBPROC glMultiTexCoord1iARB;
    extern PFNGLMULTITEXCOORD1IVARBPROC glMultiTexCoord1ivARB;
    extern PFNGLMULTITEXCOORD1SARBPROC glMultiTexCoord1sARB;
    extern PFNGLMULTITEXCOORD1SVARBPROC glMultiTexCoord1svARB ;
    extern PFNGLMULTITEXCOORD2DARBPROC glMultiTexCoord2dARB ;
    extern PFNGLMULTITEXCOORD2DVARBPROC glMultiTexCoord2dvARB;
    extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB ;
    extern PFNGLMULTITEXCOORD2FVARBPROC glMultiTexCoord2fvARB;
    extern PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
    extern PFNGLMULTITEXCOORD2IVARBPROC glMultiTexCoord2ivARB ;
    extern PFNGLMULTITEXCOORD2SARBPROC glMultiTexCoord2sARB;
    extern PFNGLMULTITEXCOORD2SVARBPROC glMultiTexCoord2svARB;
    extern PFNGLMULTITEXCOORD3DARBPROC glMultiTexCoord3dARB;
    extern PFNGLMULTITEXCOORD3DVARBPROC glMultiTexCoord3dvARB;
    extern PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3fARB;
    extern PFNGLMULTITEXCOORD3FVARBPROC glMultiTexCoord3fvARB;
    extern PFNGLMULTITEXCOORD3IARBPROC glMultiTexCoord3iARB;
    extern PFNGLMULTITEXCOORD3IVARBPROC glMultiTexCoord3ivARB;
    extern PFNGLMULTITEXCOORD3SARBPROC glMultiTexCoord3sARB;
    extern PFNGLMULTITEXCOORD3SVARBPROC glMultiTexCoord3svARB;
    extern PFNGLMULTITEXCOORD4DARBPROC glMultiTexCoord4dARB;
    extern PFNGLMULTITEXCOORD4DVARBPROC glMultiTexCoord4dvARB ;
    extern PFNGLMULTITEXCOORD4FARBPROC glMultiTexCoord4fARB;
    extern PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
    extern PFNGLMULTITEXCOORD4IARBPROC glMultiTexCoord4iARB ;
    extern PFNGLMULTITEXCOORD4IVARBPROC glMultiTexCoord4ivARB ;
    extern PFNGLMULTITEXCOORD4SARBPROC glMultiTexCoord4sARB;
    extern PFNGLMULTITEXCOORD4SVARBPROC glMultiTexCoord4svARB ;// Lock Array
    extern PFNGLLOCKARRAYSEXTPROC glLockArraysEXT ;
    extern PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT;//******************************************************************************//class ZGLext 
    {
    public:
    ZGLext();
    GLint maxMultitextureUnits;
    bool CheckExtension( char *extName );
    void GetExtensions();
    bool EnableMultitexture();
    bool EnableLockArray();
    void SelectMTU( int unit );
    void ChoseCombineOp( float operation );
    void LogOpenGLSystem();
    public:
    static GLuint totalTextureSize;
    static GLuint curBindTex[8]; // 已经绑定的TextureID (最大为8是参考geforce 3显卡的标准)
    static GLuint curTexID;      //当前纹理ID
    private:
    bool GL_ARB_MultiTexture;
    bool GL_Lock_Array;
    char* extString;

    };ZGLext Zero_glext;#endif