0

If I have a class in a namespace, like this:

#ifndef MyClass_h
#define MyClass_h

namespace NyNamespace
{
	class MyClass
	{
		public:
			typedef double MyType;
			MyType Read();
	};
}

#endif

And the implementation:

#include "MyClass.h"

namespace MyNamespace
{

MyClass::MyType MyClass::Read()
	{
		MyClass::MyType A;
		return A;
	}
}

I get error: 'MyClass' has not been declared.

Why does this not work?

Thanks!
Dave

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by daviddoria
0

Wow, unbelievable! Seems like there should be some better way to catch this, like "this namespace does not exist".

Sorry for the stupid typo - thanks though.

Dave

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.