为什么会出现名称空间标识符错误? [英] Why am I getting a namespace identifier error?

查看:398
本文介绍了为什么会出现名称空间标识符错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Keil uVision,并且不断出现此错误:

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?

推荐答案

您似乎正在对C ++代码使用C编译-检查编译器选项.

It looks like you are using C compilation for C++ code - check the compiler options.

在C ++中,namespace是保留字,但在C中不是,因此编译器将尝试将其解释为 identifier 而不是关键字-这样,在语法上当然毫无意义到C编译器.

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.

这篇关于为什么会出现名称空间标识符错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆