fatal error C1001: INTERNAL COMPILER ERROR

Started by
23 comments, last by Qw3r7yU10p! 19 years, 5 months ago
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.
pex.
Advertisement
operator= should return a color&, (*this, to be more specific), not void.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
I think I've only had that error when trying to do something with templates that VC6 couldn't do.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
Quote:
struct color
{
color() {}


Is that a class or a structure?
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.
Kippesoep
  • 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.
  • 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
    "I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

    http://www.silvermace.com/ -- My personal website
    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.
    pex.
    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.
    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&

    This topic is closed to new replies.

    Advertisement