我正在尝试编译一个程序(我没有编写)并且我收到以下错误:
C read.c ...
In file included from read.c:6:0:
def.h:6:6: error: #elif with no expression
make: *** [read.o] Error 1
文件def.h
如下所示:
#ifndef TRACE_DEF
#define TRACE_DEF
#ifndef L
#define L 152064 /* (352 * 288 * 1.5) */
#elif
#error "L defined elsewhere"
#endif
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
第 6 行是之前 #error "L defined elsewhere"
的行。
编译器是:
$ gcc --version
gcc-4.6.real (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
任何想法如何解决它?