善用搜索

c – Bison-3.0.4中的Linux From Scratch错误’make check’教程

所以我正在关注Linux From Scratch一书,我在第5.17 Bison-3.0.4章.

本书指示我们在make之后进行make检查以测试编译的Bison包的结果.

最初,我收到以下错误:

make[3]: Entering directory `/sources/bison-3.0'
  LEX      examples/calc++/calc++-scanner.cc
  CXX      
examples/calc++/examples_calc___calc__-calc++-scanner.o
g++: error: ./examples/calc++/calc++-scanner.cc: No such file or directory
g++: fatal error: no input files
compilation terminated.
make[3]: *** 
[examples/calc++/examples_calc___calc__-calc++-scanner.o] Error 1
make[3]: Leaving directory `/sources/bison-3.0'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/sources/bison-3.0'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/sources/bison-3.0'
make: *** [check] Error 2

但是在this website得到了一个解决方案.在发出make check之前告诉我要做以下事情:

cp Makefile Makefile.bak
sed -i '/calc++/d' Makefile
make check

这解决了问题,除了以下三个失败的检查之外,所有检查都变得绿色正常:

430: Variants lalr1.cc parse.assert api.token.constructor FAILED (c++.at:374)
431: Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} FAILED (c++.at:375)
432: Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations FAILED (c++.at:376)

我尝试在Google上搜索但什么也没得到.

有任何想法吗?

解决方法:

这是常见的错误.如Chapter 4.6. About the Test Suites所述:

Experience has shown that there is little to be gained from running
the test suites in Chapter 5. There can be no escaping the fact that
the host system always exerts some influence on the tests in that
chapter, often causing inexplicable failures. Because the tools built
in Chapter 5 are temporary and eventually discarded, we do not
recommend running the test suites in Chapter 5 for the average reader.
**The instructions for running those test suites are provided for the
benefit of testers and developers, but they are strictly optional.**

解决方案很简单 – 不要对第5章中编译的软件包运行测试.它们会失败并且没有任何意义.在构建真实系统时,测试在第6章中非常重要.

发表评论
退出移动版