【发布时间】:2010-04-10 05:40:04
【问题描述】:
当我尝试编译这个琐碎的 lex 程序的输出时:
# lex.l
integer printf("found keyword INT");
使用:
$ gcc lex.yy.c
我明白了:
Undefined symbols:
"_yywrap", referenced from:
_yylex in ccMsRtp7.o
_input in ccMsRtp7.o
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
lex --version 告诉我我实际上使用的是“flex 2.5.35”,尽管 ls -fla `which lex` 不是符号链接。任何想法为什么输出无法编译?
【问题讨论】: