相关疑难解决方法(0)

无法编译lex的输出

当我尝试编译这个简单的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`不是符号链接.任何想法为什么输出不会编译?

gcc lex lexer

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

标签 统计

gcc ×1

lex ×1

lexer ×1