gpt4 book ai didi

gcc - 构建 gcc 4.6 时遇到问题 : undefined reference to `yylex'

转载 作者:行者123 更新时间:2023-12-02 02:45:38 26 4
gpt4 key购买 nike

我正在尝试构建 gcc 4.6,但我收到一些链接器错误,看起来这意味着 bison 或 flex 没有链接到。当 makefile 发出此命令时:

gcc   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -DGENERATOR_FILE  -o build/gengtype \
build/gengtype.o build/errors.o build/gengtype-lex.o build/gengtype-parse.o build/version.o ../../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a

它告诉我:

/home/chris/code/gcc/trunk/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/gengtype.c:960: undefined reference to `lexer_line'
... undefined reference to `yylex'
... undefined reference to `yybegin'
... undefined reference to `yyend'

我已经安装了 Flex 和 Bison,甚至尝试了几个 Bison 变体,但结果相同。有人知道这还意味着什么吗?

最佳答案

同样的情况也发生在我身上,这是由于缺乏弹性和 Bison 。安装完flex和bison后,我运行了make distclean./configure,然后它就编译好了。

关于gcc - 构建 gcc 4.6 时遇到问题 : undefined reference to `yylex' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4262531/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com