Makefile:crt1.o:在函数`_start':(。text + 0x20)中:未定义引用`main'

时间:2018-05-05 19:15:20

标签: c makefile

当我编译我的makefile时,我遇到了这个问题:

gcc   parser.tab.o   -o parser.tab
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
parser.tab.o: In function `yyparse':
parser.tab.c:(.text+0x2c3): undefined reference to `yylex'
parser.tab.c:(.text+0x3f5): undefined reference to `execute'
parser.tab.c:(.text+0x82b): undefined reference to `yyerror'
parser.tab.c:(.text+0x947): undefined reference to `yyerror'
collect2: ld returned 1 exit status
make: *** [parser.tab] Error 1

这是我的make文件:

CC = gcc
CFLAGS = -lreadline 
PROGS = d8sh parser.tab executor lexer


all: $(PROGS)

clean:
    rm -f *.o $(PROGS) *.tmp

d8sh: d8sh.o

d8sh.o: executor.h lexer.h

executor.o: command.h

lexer.o: parser.tab.h

parser.tab.o: command.h

只有d8sh.c有一个主要功能。谁能弄明白问题是什么?

0 个答案:

没有答案
相关问题