Pregunta

Error descriptions

I'm getting these 2 errors whilst archiving the project.

  • Macro name is missing
  • Macro names must be identifiers

Any ideas what's going on?

¿Fue útil?

Solución

What it says on the tin.

The first is #define, if you have this on its own, what is it defining? You need an identifier/name after the #define, such as #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.

Otros consejos

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, i.e. MY_MACRO=1

You are using macro without giving name. You've to use #define with name as follows and have to give value for that macro

#define macroname macrovalue

second one is you can't use numbers in macro but you are giving
#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. all identifiers must start with a letter(or _) :)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top