野牛。exe无法找到文件m4sugar。m4是VS2010中MSBuild所要求的。

时间:2021-08-01 09:33:56

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.

我尝试在Visual Studio中编译QGIS。我使用OSGeo4W下载软件包,添加Flex。exe和野牛。exe到我的环境路径。下载QGIS版本2.0,并使用“Visual Studio 10”选项启动了一个cmakegui。然后,我使用GUI工具来配置我的路径。

野牛。exe无法找到文件m4sugar。m4是VS2010中MSBuild所要求的。野牛。exe无法找到文件m4sugar。m4是VS2010中MSBuild所要求的。野牛。exe无法找到文件m4sugar。m4是VS2010中MSBuild所要求的。

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"

然后我点击configure并生成,它就成功了。我查看了我的目录,有一些Visual Studio解决方案文件供我使用。然后点击"Build All"然后在"输出窗口"中得到如下输出

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 displayed
Generating qgsexpressionparser.cpp but it just stalled there and wasn't able to give anymore output.

这就是我被卡住的地方。我首先尝试的是下载m4sugar。m4,我在这里找到了——我并不认为它会起作用,因为我是从apple.com下载的,但我认为它值得一试,我把它放在正确的目录,然后点击build…这一次它显示生成qgsexpressionparser。cpp,但是它在那里停滞了,不能再输出了。

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?

读了一些书之后,我的印象是m4sugar。m4不是标准文件,在运行msys或cygwin时需要使用它。于是我尝试用MSys构建Visual Studio,但我无法运行vcvars32.bat。也许我应该用这种方法更努力些?无论如何,要让m4文件工作?

1 个解决方案

#1


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.

我想节省时间,所以我复制了野牛。exe到我的c:\osgeo4w\bin已经设置在%PATH%。它需要所有这些文件。所以我改变了我的CMake-GUI的路径以指向真正的Bison。exe访问适当的相对路径,我确保它不在一个带有空格的目录中,然后重新配置了我的CMake-GUI,并重新生成了我的项目,现在它正在工作。

#1


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.

我想节省时间,所以我复制了野牛。exe到我的c:\osgeo4w\bin已经设置在%PATH%。它需要所有这些文件。所以我改变了我的CMake-GUI的路径以指向真正的Bison。exe访问适当的相对路径,我确保它不在一个带有空格的目录中,然后重新配置了我的CMake-GUI,并重新生成了我的项目,现在它正在工作。