I have a header file config.h
where I'm simply defining a string with a value using
namespace configuration {
const char* name = "test";
}
And I access it from a .cpp
file as configuration::name
. But then I'm getting a compiler error:
error: ld returned 1 exit status
If I change it to const string name = "test";
it works. Why? And how do I fix this to be able to use a const char*
instead?