This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Does not name a type
- From: corey taylor <corey dot taylor at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Cc: Eljay Love-Jensen <eljay at adobe dot com>
- Date: Sun, 12 Jun 2005 20:31:40 -0500
- Subject: Re: Does not name a type
- References: <2e393d0805061022465e7a2b24@mail.gmail.com>
- Reply-to: corey taylor <corey dot taylor at gmail dot com>
This oddity was fixed by removing an include to a .h that also
included the file included from.
Simply using a forward declaration of the class in the .h that
included the file included from here -- which contained the typedef,
resulted in a proper build.
The error message was rather confusing and threw me off :)
Using the analogy below: file1.h included a file3.h that included
file1.h and this caused the error when file2.h included file1.h
corey
On 6/11/05, corey taylor <corey.taylor@gmail.com> wrote:
> I am testing a library build with 4.0 and am having a strange issue
> with a typdef that I cannot explicitly tie to a c++ spec requirement
> or point.
>
> This is not the same code but the same sequence as the classes are a
> little large:
>
> file1.h:
>
> typedef ReferenceCountedPointer< class VARArea > VARAreaRef;
>
> class VARArea : public ReferenceCountedObject { .. };
>
> file2.h:
>
> #include "file1.h"
>
> VARAreaRef area;
>
> at the point gcc errors saying that VARAreaRef does not name a type.
>
> It didn't error when VARAreaRef was used in file1.h later in the class
> definition.
>
> corey
>