当我尝试编译这个简单的lex程序的输出时:
# lex.l
integer printf("found keyword INT");
Run Code Online (Sandbox Code Playgroud)
使用:
$ gcc lex.yy.c
Run Code Online (Sandbox Code Playgroud)
我明白了:
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
Run Code Online (Sandbox Code Playgroud)
lex --version告诉我,我实际上正在使用'flex 2.5.35',尽管ls -fla`其中lex`不是符号链接.任何想法为什么输出不会编译?