【发布时间】:2021-12-10 01:16:23
【问题描述】:
我正在尝试在 Visual Studio 2015 中编译 CFortranTranslator。
得到以下错误:
1>------ Rebuild All started: Project: CFortranTranslator, Configuration: Debug x64 ------
2>------ Rebuild All started: Project: cpptest, Configuration: Debug x64 ------
1> Process "for90.y" bison file
2> main.cpp
1>C:\Users\pc\source\repos\CFortranTranslator\src\grammar\custom_build_rules\win_flex_bison_custom_build.targets(55,5): error MSB3721: The command "
1>C:\Users\pc\source\repos\CFortranTranslator\src\grammar\custom_build_rules\win_flex_bison_custom_build.targets(55,5): error MSB3721: start /B /WAIT /D "C:\Users\pc\source\repos\CFortranTranslator\src\grammar\" win_bison.exe --output="for90.tab.cpp" --defines="for90.tab.h" "for90.y"
1>C:\Users\pc\source\repos\CFortranTranslator\src\grammar\custom_build_rules\win_flex_bison_custom_build.targets(55,5): error MSB3721: exit /b %errorlevel%" exited with code 1.
2> cpptest.vcxproj -> C:\Users\pc\source\repos\CFortranTranslator\vsbuild\x64\Debug\cpptest.exe
2> cpptest.vcxproj -> C:\Users\pc\source\repos\CFortranTranslator\vsbuild\x64\Debug\cpptest.pdb (Partial PDB)
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
flex-bison 已经在指定目录中:
那么,我应该怎么做才能解决这个问题?
编辑:遵循 Robert 的指示后,与 Flex/Bison 相关的错误消失了。谢谢他。
但是,现在,我发现应用程序没有找到 Boost,即使它已经安装了。
1>------ Rebuild All started: Project: CFortranTranslator, Configuration: Debug x64 ------
1> Process "for90.y" bison file
1> Process "for90.l" flex file
1> lazygen.cpp
1> gen_variable.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_vardef.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_type.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_suite.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_stmt.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_select.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_program.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_paramtable.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_label.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_io.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_if.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_function.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_feature.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_exp.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_doc.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_do.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_dimenslice.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_config.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_callable.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> Generating Code...
1> Compiling...
1> gen_attr_describer.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_arraybuilder.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> gen_common.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> Variable.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> tokenizer.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> parser.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> Intent.cpp
1> Function.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> attribute.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> main.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> simple_lexer.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> for90.tab.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\src\grammar\for90.tab.cpp': No such file or directory
1> getopt2.cpp
1> develop.cpp
1>c:\users\pc\source\repos\calvinneo\cfortrantranslator\src\parser\variable.h(22): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory
1> forstdio.cpp
1> forlang.cpp
1> forfilesys.cpp
1> for90std.cpp
1> farray.cpp
1> Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
EDIT-2:
我解决了 Boost 问题。
现在,我遇到以下错误:
for90.tab.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\src\grammar\for90.tab.cpp': No such file or directory
【问题讨论】:
-
看起来与类似 repo github.com/lexxmark/winflexbison/blob/master/custom_build_rules/… 中描述的错误相似,他们提供了一些建议
-
@chickitychinachinesechicken,这个指南不起作用。
-
@user366312,在您增加 MSBuild 项目构建输出详细程度后,您能否分享输出的错误(如链接 chikity 共享的建议)?
-
@diogoslima,输出和我已经提供的一样。
-
哦,我没想到会是一样的。 Doble 检查完整性:如果您在同一位置打开命令提示符并运行“win_bison.exe”,并传递相同的参数,所有这些都成功运行而没有“win_bison.exe”输出任何错误?基本上,已确认问题与自定义构建事件有关?
标签: c++ visual-studio bison flex-lexer