本文介绍了建立gcc 4.6的麻烦:对'yylex'的未定义引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试构建gcc 4.6,但是我收到了一些链接器错误,看起来像是意味着bison或flex没有链接到它。当makefile发出这个命令时:
I'm trying to build gcc 4.6, but I'm getting some linker errors that look like it means bison or flex isn't getting linked to. When the makefile issues this command:
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变种与相同的结果。是否有人知道这可能意味着什么?
I've installed Flex and Bison, and even tried several Bison variants with the same result. Does anybody know what else this might mean?
推荐答案
同样发生在我身上,这是由于缺乏灵活性和野牛。安装flex和bison之后,我运行了 make distclean
和 ./ configure
,然后编译好。
Same happened to me, it was due to lack of flex and bison. After installing flex and bison, I ran make distclean
and ./configure
, then it compiled fine.
这篇关于建立gcc 4.6的麻烦:对'yylex'的未定义引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!