Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting a namespace identifier error?

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?

like image 230
user3729617 Avatar asked Jun 30 '14 10:06

user3729617


1 Answers

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.

like image 111
Clifford Avatar answered Sep 27 '22 21:09

Clifford