zoukankan      html  css  js  c++  java
  • lex error

    使用lex 是有好几次的接触, 最近看bpf的代码里面用到了lex, 于是代码也看不懂了

    1.l:

    %%
    .|     ECHO;
    %%

    $ lex 1.l

    km@kwingmei:~/programming/c/lex$ gcc lex.yy.c
    /tmp/ccehk4zT.o: In function `yylex':
    lex.yy.c:(.text+0x38b): undefined reference to `yywrap'
    /tmp/ccehk4zT.o: In function `input':
    lex.yy.c:(.text+0xcd6): undefined reference to `yywrap'
    collect2: error: ld returned 1 exit status

    错误原因是

    The scanner calls this function on end of file, so you can point it to another file and continue scanning its contents.

    If you don't need this, use

    %option noyywrap
    

    or link with -lfl to use the default yywrap() function in the library fl.

  • 相关阅读:
    Xcode And iOS9新特性
    AutoLayout
    本地化
    Map
    iOS多线程编程
    第三方抽屉效果
    iPad编程
    CoreData / MagicalRecord
    js清除单选框所选的值
    js获取背景颜色
  • 原文地址:https://www.cnblogs.com/kwingmei/p/3612661.html
Copyright © 2011-2022 走看看