Thread overview
documentation: "namespace 'Foo' does not enclose '?0' of namespace 'Foo'"
Jan 14, 2004
Scott Michel
Jan 15, 2004
Jan Knepper
Jan 15, 2004
Scott Michel
Jan 15, 2004
Scott Michel
Jan 15, 2004
Scott Michel
Jan 15, 2004
Jan Knepper
Jan 15, 2004
Scott Michel
January 14, 2004
I've looked for documentation on this error, since I've just encountered it. I could upload the preprocessed version of the source code, but the basic jist of it is as follows:

namespace Foo
{
  class Layer
  {
  public:
    Layer();
    virtual ~Layer();
  };
};

namespace Foo
{
  Layer::Layer()  /* <-- here's where error is encoutered */
  {
   // various initialization code
  }
}

Any clues as to what causes the compiler to complain and what can I do to hack around it?


-scooter
January 15, 2004
What is the error you are getting?
I am pretty sure I have this in code several times and no problems what-so-ever...




Scott Michel wrote:
> I've looked for documentation on this error, since I've just encountered it.
> I could upload the preprocessed version of the source code, but the basic
> jist of it is as follows:
> 
> namespace Foo
> {
>   class Layer
>   {
>   public:
>     Layer();
>     virtual ~Layer();
>   };
> };
> 
> namespace Foo
> {
>   Layer::Layer()  /* <-- here's where error is encoutered */
>   {
>    // various initialization code
>   }
> }
> 
> Any clues as to what causes the compiler to complain and what can I do to
> hack around it?
> 
> 
> -scooter


-- 
ManiaC++
Jan Knepper

But as for me and my household, we shall use Mozilla... www.mozilla.org
January 15, 2004
Jan Knepper wrote:

> What is the error you are getting?
> I am pretty sure I have this in code several times and no problems
> what-so-ever...

The subject string is the exact error message I'm getting. It just so happens that the namespace isn't "Foo", it's "FLAPPS". And the code is similar to what I have (except it's a little more complex.)


namespace 'FLAPPS' does not enclose '?0' of namespace 'FLAPPS'




-scooter


> Scott Michel wrote:
>> I've looked for documentation on this error, since I've just encountered it. I could upload the preprocessed version of the source code, but the basic jist of it is as follows:
>> 
>> namespace Foo
>> {
>>   class Layer
>>   {
>>   public:
>>     Layer();
>>     virtual ~Layer();
>>   };
>> };
>> 
>> namespace Foo
>> {
>>   Layer::Layer()  /* <-- here's where error is encoutered */
>>   {
>>    // various initialization code
>>   }
>> }
>> 
>> Any clues as to what causes the compiler to complain and what can I do to hack around it?
>> 
>> 
>> -scooter
> 
> 

January 15, 2004
Scott Michel wrote:

> Jan Knepper wrote:
> 
>> What is the error you are getting?
>> I am pretty sure I have this in code several times and no problems
>> what-so-ever...
> 
> The subject string is the exact error message I'm getting. It just so happens that the namespace isn't "Foo", it's "FLAPPS". And the code is similar to what I have (except it's a little more complex.)
> 
> 
> namespace 'FLAPPS' does not enclose '?0' of namespace 'FLAPPS'
> 
> 
> 
> 
> -scooter

I could post the listing file, at the risk of polluting the newsgroup with my code. If it would help...


-scooter
January 15, 2004
Here's the compiler's output. I tried to get a sane listing file, but it's incomplete.

sc -Ae -Ar -mn -C -WD -S -Ns -R -ND -5 -a8 -c -gf -gp -DFLAPPSDLL_EXPORTS
-DDLL_EXPORTS -D_DLL -I\dm\stlport\stlport -I. -I.\include -I.\sprng2.
\include -o.\build\flappslayer.obj SRC\flappslayer.cxx
Error: D:\USERS\SCOTTM\PLAY\FLAPPS-JNI\SRC\flappslayer.cxx(60): namespace
'FLAPPS' does not enclose member '?0' of namespace 'FLAPPS'
Error: D:\USERS\SCOTTM\PLAY\FLAPPS-JNI\SRC\flappslayer.cxx(69): namespace
'FLAPPS' does not enclose member '?0' of namespace 'FLAPPS'
Error: D:\USERS\SCOTTM\PLAY\FLAPPS-JNI\SRC\flappslayer.cxx(79): namespace
'FLAPPS' does not enclose member '?R' of namespace 'FLAPPS'
Error: D:\USERS\SCOTTM\PLAY\FLAPPS-JNI\SRC\flappslayer.cxx(87): namespace
'FLAPPS' does not enclose member '?R' of namespace 'FLAPPS'
Fatal Error: D:\USERS\SCOTTM\PLAY\FLAPPS-JNI\SRC\flappslayer.cxx(99): too
many errors
Lines Processed: 53222  Errors: 5  Warnings: 0
Build failed


Jan Knepper wrote:

> What is the error you are getting?
> I am pretty sure I have this in code several times and no problems
> what-so-ever...
> 
> 
> 
> 
> Scott Michel wrote:
>> I've looked for documentation on this error, since I've just encountered it. I could upload the preprocessed version of the source code, but the basic jist of it is as follows:
>> 
>> namespace Foo
>> {
>>   class Layer
>>   {
>>   public:
>>     Layer();
>>     virtual ~Layer();
>>   };
>> };
>> 
>> namespace Foo
>> {
>>   Layer::Layer()  /* <-- here's where error is encoutered */
>>   {
>>    // various initialization code
>>   }
>> }
>> 
>> Any clues as to what causes the compiler to complain and what can I do to hack around it?
>> 
>> 
>> -scooter
> 
> 

January 15, 2004
Try to add a ';'

Scott Michel wrote:
> I've looked for documentation on this error, since I've just encountered it.
> I could upload the preprocessed version of the source code, but the basic
> jist of it is as follows:
> 
> namespace Foo
> {
>   class Layer
>   {
>   public:
>     Layer();
>     virtual ~Layer();
>   };
> };
> 
> namespace Foo
> {
>   Layer::Layer()  /* <-- here's where error is encoutered */
>   {
>    // various initialization code
>   }

// Here ->
};		// namespace Foo



> 
> Any clues as to what causes the compiler to complain and what can I do to
> hack around it?
> 
> 
> -scooter


-- 
ManiaC++
Jan Knepper

But as for me and my household, we shall use Mozilla... www.mozilla.org
January 15, 2004
It turns out that I was missing a '}' at the end of a much earlier header file. I realize that one trades something for speed (TANSTAAFL), but error messages could be a little bit better, e.g., hit the end of the file and scopes arent closed (seems to be the problem in this case.)

Another small nit is when an error occurs in a header file, it'd be nice to see the header stack that led up to the error.

For an inexpensive compiler and IDDE (and I bought the CD), it ain't bad.

Also, this error message does need to show up in the documentation.


-scooter

Jan Knepper wrote:

> Try to add a ';'
> 
> Scott Michel wrote:
>> I've looked for documentation on this error, since I've just encountered it. I could upload the preprocessed version of the source code, but the basic jist of it is as follows:
>> 
>> namespace Foo
>> {
>>   class Layer
>>   {
>>   public:
>>     Layer();
>>     virtual ~Layer();
>>   };
>> };
>> 
>> namespace Foo
>> {
>>   Layer::Layer()  /* <-- here's where error is encoutered */
>>   {
>>    // various initialization code
>>   }
> 
> // Here ->
> };            // namespace Foo
> 
> 
> 
>> 
>> Any clues as to what causes the compiler to complain and what can I do to hack around it?
>> 
>> 
>> -scooter
> 
>