Undefined reference to yyparse (flex & bison)

前端 未结 2 1966
执念已碎
执念已碎 2021-02-06 11:37

I\'m attempting to learn some flex/bison, and I\'m reading Flex & Bison by John Levine (O\'Reilly). There is an example that I need to get running, however I can\'t get it

相关标签:
2条回答
  • 2021-02-06 12:08

    I read that chapter as well and I believe the author is indicating that the code should be put in a "Makefile" to automate the build process for said files.

    The $@ is a variable expansion used in bash shell scripts (among other places) and probably does the same thing in make or is exactly the same thing that make is implementing.

    0 讨论(0)
  • 2021-02-06 12:12

    Solved it, the command

    cc -o $@ fb3-1.tab.c fb3-1.lex.c fb3-1funcs.c
    

    Should be

    cc -o fb3 fb3-1.tab.c fb3-1.lex.c fb3-1funcs.c
    

    Not sure why the book didn't specify that for the example.

    0 讨论(0)
提交回复
热议问题