[英]Lexical or Preprocessor issue
I'm getting these 2 errors whilst archiving the project. 归档项目时出现这两个错误。
Any ideas what's going on? 有什么想法吗?
What it says on the tin. 它在锡罐上说了什么。
The first is #define
, if you have this on its own, what is it defining? 第一个是#define
,如果您自己拥有它,它的定义是什么? You need an identifier/name after the #define
, such as #define VARIABLE
. #define
后需要一个标识符/名称,例如#define VARIABLE
。
The second does provide some sort of name, but it's simply a number. 第二个确实提供了某种名称,但这只是一个数字。 Identifiers cannot start with a number (just like variable names can't). 标识符不能以数字开头(就像变量名不能一样)。 and hence isn't classed as an identifier. 因此未归类为标识符。
I got the same errors when attempting to define preprocessor macros in Build Settings as follows 尝试在“构建设置”中定义预处理器宏时,出现了相同的错误,如下所示
Preprocessor Macros
DEBUG=1 MY_MACRO = 1
So, the parser does not like spaces, ie MY_MACRO=1 因此,解析器不喜欢空格,即MY_MACRO = 1
You are using macro
without giving name
. 您正在使用macro
而未给出name
。 You've to use #define
with name as follows and have to give value for that macro
您必须按以下方式使用#define
的名称,并必须为该macro
提供值
#define macroname macrovalue
second one is you can't use numbers
in macro
but you are giving 第二个是你不能在macro
使用numbers
,但是你给
#define 0 1
it should be like 它应该像
#define ZERO 1
you are using 0 as a NAME of a macro, a digit is no valid name for any variable, functions or macro. 您将0用作宏的名称,数字对于任何变量,函数或宏均无效。 all identifiers must start with a letter(or _) :) 所有标识符都必须以字母(或_)开头:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.