I am using Keil uVision and I keep getting this error:
C:\Keil_v5\ARM\ARMCC\bin\..\include\rw/_defs.h(781): error: #20:
identifier "namespace" is undefined
What could lead to this error? Isn´t namespace automatically defined?
I am using Keil uVision and I keep getting this error:
C:\Keil_v5\ARM\ARMCC\bin\..\include\rw/_defs.h(781): error: #20:
identifier "namespace" is undefined
What could lead to this error? Isn´t namespace automatically defined?
It looks like you are using C compilation for C++ code - check the compiler options.
In C++ namespace
is a reserved word, but not in C, so the compiler will try to interpret it as an identifier rather than a keyword - which will then of course make no sense syntactically to a C compiler.
You did not expose many details but my hunch is that you use a C compiler for your C++ program. There are no namespaces in C.
I could produce similar messages with this program:
namespace test {
}
Output:
$ gcc test.c
test.c:1:1: error: unknown type name 'namespace'
namespace test {
^
test.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{
' token
namespace test {
^