Re: Does not name a type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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
>


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux