问题
I am trying to compile QGIS in Visual Studio. I used OSGeo4W to download the packages, added Flex.exe and Bison.exe to my environment path. Downloaded QGIS Release 2.0, and launched a CMake-GUI with the option "Visual Studio 10". Then I configured my paths using the GUI tool.
Then I hit configure and generate, and it worked. I looked in my directory and there were Visual Studio Solution files available for me. Then I hit "Build All" and I got the following output in the "Output Window"
Generating flex_qgsexpressionlexer.cpp
Generating qgsexpressionparser.cpp 1> C:\OSGeo4W\bin\bison.exe: cannot open file
`C:\OSGeo4W/share/bison/m4sugar/m4sugar.m4': No such file or directory
So this is where I am stuck. The first thing I tried was to download m4sugar.m4, which I found here -- I didn't really think it would work since I downloaded it from apple.com, but I thought it was worth a shot, I put it in the correct directory, and hit build... This time it displayedGenerating qgsexpressionparser.cpp
but it just stalled there and wasn't able to give anymore output.
After doing some reading I got the impression that m4sugar.m4 is somehow not a standard file and that you need to use it while running msys or cygwin. So then I tried to do my Visual Studio Build with MSys but I was unable to run vcvars32.bat. Maybe I should try harder with that approach? Anyway to get this m4 file working?
回答1:
Ok, so I was lazy.
I wanted to save time so i just copied the bison.exe to my c:\osgeo4w\bin with was already set in my %PATH%. And it requires all these other files. So I changed the path in my CMake-GUI to point to the actual Bison.exe with access to the appropriate relative paths, and I made sure that it wasn't in a directory with spaces, and then reconfigured my CMake-GUI and regenerated my project, and its working now.
来源:https://stackoverflow.com/questions/19138638/bison-exe-cannot-find-file-m4sugar-m4-which-is-required-by-an-msbuild-in-vs2010