<Command Line>:1:1: Error: MACro Names Must Be Identifiers

command line :1:1: error: macro names must be identifiers

You have a -D flag with no name. Look in your makefile to see what is causing it.

command-line :0:1: error: macro names must be identifiers ........ Solution for this error?

The (writer of) the Makefile doesn't take into account that the environment variable DISPLAY can be defined to something else than a macro definition. As it's not documented whether and how you'd need to define it, the best you can do is to make with the variable unset:

(unset DISPLAY; make)

If you prefer to change the makefile, just remove the ? from DISPLAY?=ERROR, leaving DISPLAY=ERROR.

Error: macro names must be identifiers using #ifdef 0

The #ifdef directive is used to check if a preprocessor symbol is defined. The standard (C11 6.4.2 Identifiers) mandates that identifiers must not start with a digit:

identifier:
identifier-nondigit
identifier identifier-nondigit
identifier digit
identifier-nondigit:
nondigit
universal-character-name
other implementation-defined characters>
nondigit: one of
_ a b c d e f g h i j k l m
n o p q r s t u v w x y z
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
digit: one of
0 1 2 3 4 5 6 7 8 9

The correct form for using the pre-processor to block out code is:

#if 0
: : :
#endif

You can also use:

#ifdef NO_CHANCE_THAT_THIS_SYMBOL_WILL_EVER_EXIST
: : :
#endif

but you need to be confident that the symbols will not be inadvertently set by code other than your own. In other words, don't use something like NOTUSED or DONOTCOMPILE which others may also use. To be safe, the #if option should be preferred.

SIGKILL error and command line 0:1 macro names must be identifiers error in trying to use rebound

I have solved it - kind of. I could never get it working on MinGW, but after installing cygwin and installing the requisite packages (even though I could have sworn I did so on MinGW as well), I made progress and it stopped giving me this error. It did give me trouble with freeglut though - turns out I hadn't actually managed to solve that in MinGW, so I did some digging there and discovered I needed to use Cygwin's Xterminal instead of just the standard one, and then it found all the OpenGL files just fine.

Long story short, if you run into this problem and you can't find anything in the code at the source, try double checking your installed libraries - I suppose I just wasn't thorough enough.

Macro name must be an identifier

You cannot have anything following #if expand to defined. That is subject to undefined behavior.

From the C99 Standard (emphasis mine):

6.10.1 Conditional inclusion

...

3 Preprocessing directives of the forms

 # if *constant-expression new-line group<sub>opt</sub>*
# elif *constant-expression new-line group<sub>opt</sub>*

check whether the controlling constant expression evaluates to nonzero.

4 Prior to evaluation, macro invocations in the list of preprocessing tokens that will become the controlling constant expression are replaced (except for those macro names modified by the defined unary operator), just as in normal text. If the token defined is generated as a result of this replacement process or use of the defined unary operator does not match one of the two specified forms prior to macro replacement, the behavior is undefined.

Xcode 7 - macro name must be an identifier

The problem is with the -D=1 command-line option in the compile command. You have a bad value somewhere in your build settings, probably in Preprocessor Macros or Other C Flags.



Related Topics



Leave a reply



Submit