我试图建立gcc 4.6,但我得到了一些链接错误,这似乎意味着野牛或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变体。有人知道这还意味着什么吗?
发布于 2011-01-29 19:01:21
同样的事情也发生在我身上,这是由于缺乏弯曲和野牛。在安装了flex和bison之后,我运行了make distclean
和./configure
,然后它编译得很好。
发布于 2012-12-31 17:00:08
我也遇到了这种情况,但我的修复方法是安装bisonc++,无论出于什么原因,我只安装了bison。
发布于 2010-11-24 08:21:57
自从我这么做之后,它就进入了一种奇怪的状态。/配置它,并试图在bison和flex正确设置之前构建它。光说干净是不够的。我把所有的东西都擦掉了,做了一次新的检查,现在一切都好了。
https://stackoverflow.com/questions/4262531
复制相似问题