Sign in to follow this  

fatal error C1001: INTERNAL COMPILER ERROR

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i use Visual C++ 6.0 Standard Edition SP6, but i think the error is an out of memory error.. it doesn't appear when i remove:
struct color
{
	color() {}
	color(float r,float g,float b,float a=0.0)
	{
		this->r=r;
		this->g=g;
		this->b=b;
		this->a=a;
	}
	void operator = (const color c)
	{
		this->r=c.r;
		this->g=c.g;
		this->b=c.b;
		this->a=c.a;
	};
	float r,g,b,a;
};


or the vector struct (the color struct is 16 bytes(i used sizeof(), its smaller than the vector struct)) when i got this error in the beginning i also got a warning that says '/0b0' is unknown (i couldn't find it in the project options). so i added this '/0b0' and then removed it, and now i dont get this warning anymore. the fatal error points to the line:
	C = 2,				/* The Z value of the plane's normal */

its a part of my frustum culling (the frustum culling works well, now i tried to implement a good lighting class) btw, i dont really think i wrote something new so i got this error. i was trying to find out a solution to some weird error which isn't fatal. and i got the '/0b0' warning before i installed SP6. does anyone here know where i get the sp version in vc6? just to make sure i have sp6 installed well. (its the second question. the first is why i get this error and how to solve it) thanks in advance, pex.

Share this post


Link to post
Share on other sites
I think I've only had that error when trying to do something with templates that VC6 couldn't do.

Share this post


Link to post
Share on other sites
Look at operator=. There's a semi-colon at the end which shouldn't be there. I seem to recall this particular thing causing an ICE.

Share this post


Link to post
Share on other sites
  • You don't need to overload operator =. C++ compilers predefine operator = for you that does the exact same thing.
  • (if you still want to overload it) operator = should return a color&. return *this; at the end of the function.

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by Archi
    Quote:

    struct color
    {
    color() {}


    Is that a class or a structure?
    C++ only differentiates between a struct and a class by the fact that a struct is by default public and a class is by default private.

    struct A { void foo(); } //foo is public
    class A { void foo(); } //foo is private

    Share this post


    Link to post
    Share on other sites
    ok guys, so i commented the operator=, but still same error..
    1) any more ideas?..
    Quote:
    Original post by pex22
    does anyone here know where i get the sp version in vc6? just to make sure i have sp6 installed well. (its the second question. the first is why i get this error and how to solve it)

    2) nobody here knows how to get the sp version in vc6?..
    Quote:
    Original post by pex22
    or the vector struct (the color struct is 16 bytes(i used sizeof(), its smaller than the vector struct))

    dont forget the error is not in the color struct, because when i remove the vector struct i also get this error (the vector struct is old, it worked before this error. the color struct is new)

    how can i do that the vc will use more ram than it does now? i still think the memory is the problem..so i have to try it.

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by silvermace
    Quote:
    Original post by Archi
    Quote:

    struct color
    {
    color() {}


    Is that a class or a structure?
    C++ only differentiates between a struct and a class by the fact that a struct is by default public and a class is by default private.

    struct A { void foo(); } //foo is public
    class A { void foo(); } //foo is private


    And structs inherit publicly by default and classes inherit privately by default.

    Share this post


    Link to post
    Share on other sites
    Download Borland C++ (command line compiler 5.5) (It's completely gratis, although it is a 9MB download) and try compiling the files one by one, see what borland says. Or you could try gcc. Or quickc.
    Just try anything other than VC. :)
    Although, this option really is a last resort..

    //Edit:
    operator = should also take its argument as a const color&

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by MrEvil
    Download Borland C++ (command line compiler 5.5) (It's completely gratis, although it is a 9MB download) and try compiling the files one by one, see what borland says. Or you could try gcc. Or quickc.
    Just try anything other than VC. :)
    Although, this option really is a last resort..

    //Edit:
    operator = should also take its argument as a const color&

    i have Dev-C++, but i prefer using VC instead.

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by pex22
    2) nobody here knows how to get the sp version in vc6?..

    Here.

    I've got INTERNAL COMPILER ERROR twice when using VC6.0. One when I use templates and the other when I use friend functions along with namespace std. Not sure what in your case, but if you are using templates, you might want to try commenting it out and see if it works. using namespace std can cause problems too. Your color struct may not be the cause of the problem, but rather something else that is conflicting with it. Try putting your color struct in a namespace (maybe name collision), or remove those this's. VC6 compiler is broken.

    Share this post


    Link to post
    Share on other sites
    Guest Anonymous Poster
    oops, i meant how i find out what sp version is installed in my vc..my bad
    i namespaced it and it doesn't give me this error anymore.
    but when i use it, like this:
    n::color C (float,float,float,float=0.0);

    it give me that fatal error back..
    i downloaded the free .net compiler toolkit (or something like this) but haven't installed it yet.
    is it possible to install it somehow in vc6? how? (a ready tutorial or something. or all i have to do is to overwrite the exist directories with the .net directories that i have downloaded?)

    Share this post


    Link to post
    Share on other sites
    There's no reason to be using VC6 anymore when the VC7.1 compiler is freely available from MS. I have gotten ICEs from VC6 a few times, mostly just while learning C++, ironically.

    Share this post


    Link to post
    Share on other sites
    oh, nevermind.
    i namespaced both structs and it works.
    thanks again! [smile]

    Share this post


    Link to post
    Share on other sites
    Quote:

    n::color C (float,float,float,float=0.0);


    I don't know what the hell you are trying to do there, the whole point of default arguments is that you don't need to pass a value in if you don't want to - they should only be present in the function definition and not when declaring an object.

    Try actually using valid values like 0.0f instead of just float or alternatively just declate it as n::color C; if it's just for test purposes.

    Share this post


    Link to post
    Share on other sites
    thats a function definition
    whats the opposite between 0.0 and 0.0f?

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by pex22
    whats the opposite between 0.0 and 0.0f?


    The difference is:

    0.0 is a double
    0.0f is a float

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by pex22
    oh, nevermind.
    i namespaced both structs and it works.
    thanks again! [smile]


    I wouldn't be happy if the only difference is putting things in a namespace.

    Can you show a small example:

    eg


    struct color {
    //etc
    };

    int main() {
    color a;
    color b;
    a = b;
    return 0;
    }



    and make it reproduce the internal compiler error? Thanks.

    Share this post


    Link to post
    Share on other sites
    no fatal error
    i also added the vector struct, and still no fatal error.
    weird, i copied-pasted the header file and i got the error (without the namespace).
    so i removed the C () function (n::color C (float,float,float,float=0.0);) and no fatal error.
    i tried to change the C() position (i put it under the V() which is same as C() but for the vector struct and not the color struct) but still fatal error.
    when i remove the V() i still get the fatal error.
    i removed the color struct's operator and i still get the error..
    both structs looks same for me so i worry its the compiler error.

    Share this post


    Link to post
    Share on other sites
    weird, yesterday i got a fatal error.
    now, no error at all (in both projects, the test and the real one)..

    Share this post


    Link to post
    Share on other sites
    Sign in to follow this