I'm recently visiting namespaces as I have a group of functions/methods but no data, so the logical way to go would be to stick them inside a namespace. (Sorry if this question lacks anything).
I have the following:
Math.h
namespace Math {
double Euclidean();
}
Math.cpp
#include "Math.h"
double Math::Euclidean() {
// Implementation
}
And in another namespace, that I need to access the "Math" namespace:
namespace foo {
foo();
}
Foo.cpp
#include "Math.h"
#include "foo.h"
using namespace Math;
foo::foo() {
// use the math function
Math::Euclidean();
}
I get the error:
Math’ is not a namespace-name
I'm probably missing something really simple, but, I cannot seem to figure it out.
I have tried to read the following: Here but it seems that this uses a class and I wanted to do it without using classes.
double Math::Euclidiean(), theusing namespace Math;or somewhere else?"math.h"is also a C standard header. Perhaps that's what the compiler is including.someand change everything to this, I still get the error:‘some’ is not a namespace-name"Phorce_Math.h", for example, isn't already taken.