This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems with compiler differences between version 3.3.5 and 4.0.2


meanwhile i found that the compiler means it does not know the type A,
it seems clear, but older versions gave a better understandable message.
Something like this:

you use 'A' as a type, but it's not defined yet

and it was pretty clear that the compiler doesn't know A.

and SORRY but the example is picked from a much more complex case and it was not the way that class A was already defined. But i don't understand this errormessage.

Thanks, cris

Brian Budge schrieb:
It seems like in this case, this should work...  Usually this error is
found in conjunction with templates, at least in my experience.

I don't know the actual reason why g++ stopped being able to recognize
these kinds of types (I bet it has something to do with the
standard... anyone?), but the fix is usually easy...

try
typename A a;

Brian

On 2/2/06, Christian Weckmueller <cris.tian@web.de> wrote:

Hello dear gcc-helper,

I have a program without problems compiling with 3.3.5 but don't work with
4.0.2.

there is on class A and another on B
so B has a datamember an object of A, like this

class A{
...
};

class B{
...
       A a;    <<<<<<<

};

The compiler answers that:

file linenumber: A does not name a type





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]