简体   繁体   中英

How can I resolve this compile error in Visual Studio 2015?

I am trying to compile CFortranTranslator in Visual Studio 2015.

Getting the following error:

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 ==========

the flex-bison is already in the designated directory:

在此处输入图片说明

So, what should I do to resolve this?

Open the file:

... \CFortranTranslator\src\grammar\custom_build_rules\win_flex_bison_custom_build.props
  1. Go to line 16,17,18 which reads

     <CommandLineTemplate> start /B /WAIT /D "%(RootDir)%(Directory)" win_bison.exe [AllOptions] [AdditionalOptions] "%(Filename)%(Extension)" exit /b %errorlevel%</CommandLineTemplate>

Replace with (only 1 line):

  <CommandLineTemplate>start /B /WAIT /D "%(RootDir)%(Directory)" win_bison.exe [AllOptions] [AdditionalOptions] "%(Filename)%(Extension)" &amp; exit /b %errorlevel%</CommandLineTemplate>
  1. On (now) lines 34,35,36:

     <CommandLineTemplate> start /B /WAIT /D "%(RootDir)%(Directory)" win_flex.exe [AllOptions] [AdditionalOptions] "%(Filename)%(Extension)" exit /b %errorlevel%</CommandLineTemplate>

Replace with (only 1 line):

  <CommandLineTemplate>start /B /WAIT /D "%(RootDir)%(Directory)" win_flex.exe [AllOptions] [AdditionalOptions] "%(Filename)%(Extension)" &amp; exit /b %errorlevel%</CommandLineTemplate>
  1. Save the file and BUILD

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM