小编Tin*_*ark的帖子

<命令行>:1:1:错误:宏名称必须是标识符

我是Linux和makefile的新手.我有一个生成.a文件的makefile.当我运行makefile时,我收到以下错误.我不知道代码的哪一部分,错误发生.

[oracle@dyl02703app004 erm]# make -f erm_make_ida all
.... Compiling /home/wholesale/children/dev5/comps/erm/obj/ermparseyac.c
cc  -g                         -DANSI -D -DTRACE_ON -DIDA_VERSION='"ISP-RG-V5.10.7GEN2A"' -DNO_MCP -DBUILDING_ERP  -I/home/wholesale/children/dev5/comps/erm/include -I/home/wholesale/children/dev5/comps/erm/src -I/home/wholesale/children/dev5/comps/erm/module_test  -I/home/wholesale/children/dev5/comps/erm/include  -I/home/wholesale/children/dev5/comps/cfm/include    -c /home/wholesale/children/dev5/comps/erm/src/ermparseyac.c -o /home/wholesale/children/dev5/comps/erm/obj/ermparseyac.o
<command line>:1:1: error: macro names must be identifiers
make: *** [/home/wholesale/children/dev5/comps/erm/obj/ermparseyac.o] Error 1
Run Code Online (Sandbox Code Playgroud)

有什么建议...?

linux command-line gnu-make

5
推荐指数
1
解决办法
2万
查看次数

NUL未申报 - 首次使用此功能

网上我了解C包含NUL关键字.

但是在编译时我得到了一个错误

NUL undeclared first use in this function'
Run Code Online (Sandbox Code Playgroud)

我的代码片段:

for (;;) {
        char ch = (*pzDest = *pzSrc);
        if (ch == NUL)
            break;
        if (ch == ':') {
            *pzDest = NUL;
            break;
        }
        pzDest++;
        pzSrc++;
    }
Run Code Online (Sandbox Code Playgroud)

知道为什么我会收到这个错误吗?

c nul

2
推荐指数
1
解决办法
2万
查看次数

gcc中的"初始化元素不是常量"错误

我尝试使用make文件编译C代码.我收到以下错误:

/home/dev5/src/ermparselex.c:69: error: initializer element is not constant
/home/dev5/src/ermparselex.c:69: error: (near initialization for âyyinâ)
Run Code Online (Sandbox Code Playgroud)

代码段和行号:

65 int yyleng; extern char yytext[];
 66 int yymorfg;
 67 extern char *yysptr, yysbuf[];
 68 int yytchar;
 69 FILE *yyin = stdin, *yyout = stdout;
 70 extern int yylineno;
 71 struct yysvf {
 72         struct yywork *yystoff;
 73         struct yysvf *yyother;
 74         int *yystops;};
 75 struct yysvf *yyestate;
 76 extern struct yysvf yysvec[], *yybgin;
Run Code Online (Sandbox Code Playgroud)

此代码中的任何位置都未定义stdin和的值stdout.我无法从谷歌获得适当的解决方案.知道为什么会出现这个错误吗?

linux gcc initializer

2
推荐指数
1
解决办法
3773
查看次数

标签 统计

linux ×2

c ×1

command-line ×1

gcc ×1

gnu-make ×1

initializer ×1

nul ×1