使用Visual Studio 2013构建适用于WinRT的Qt

3
我从这个位置下载了Windows Runtime技术预览版的Qt:http://download.qt-project.org/development_releases/qt/winrt-tp/。按照这里的说明尝试构建时,最终遇到以下错误:
        win_flex --noline --nounistd --outfile=Tokenizer.cpp ..\..\..\..\3rdparty\angle\src\compiler\preprocessor\Tokenizer.l
'win_flex' is not recognized as an internal or external command, operable program or batch file.
NMAKE : fatal error U1077: 'win_flex' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

我该如何修复这个问题?

1
http://sourceforge.net/projects/winflexbison/ - Nathaniel Johnson
1
安装了它。将其添加到路径中,重新构建,仍然失败。 - Raman Sharma
2个回答

1
尝试这样做:当您提取源代码时,它将具有如下目录结构: .....\qtbase-opensource-src-5.3.0-WinRT-TP\qtbase-opensource-src-5.3.0-WinRT-TP\bin .....\qtbase-opensource-src-5.3.0-WinRT-TP\qtbase-opensource-src-5.3.0-WinRT-TP\src 编译脚本只是在名为gnuwin32的目录中查找win_flex。 这个目录及其内容可以在https://qt.gitorious.org/qt/qt5/source/4c925babf9e7f516479a0e418e9b3f509d3cd4b7:gnuwin32或完整的Qt5-Sources中找到(WinRT技术预览源仅是其中的一部分)。 将此目录复制到路径中,然后应该看起来像这样:

.....\qtbase-opensource-src-5.3.0-WinRT-TP\qtbase-opensource-src-5.3.0-WinRT-TP\bin

.....\qtbase-opensource-src-5.3.0-WinRT-TP\qtbase-opensource-src-5.3.0-WinRT-TP\src

.....\qtbase-opensource-src-5.3.0-WinRT-TP\gnuwin32\

注意1:从sourceforge下载win_flex或将其添加到PATH变量中均无效!编译脚本在gnuwin32目录中硬编码搜索win_flex!

注意2:我在官方博客上发表了评论,也许Digia的人会尽快修复WinRT-TP-Source-Package...


将该目录保留在该位置也没有帮助我。 - Raman Sharma

1

我从http://sourceforge.net/projects/winflexbison/安装了win_flex。

然后在我的源代码中,我进入了目录: .....\qtbase-opensource-src-5.3.0-WinRT-TP\qtbase-opensource-src-5.3.0-WinRT-TP\src\angle\src\compiler\preprocessor

并更改了Makefile.debug和Makefile.release,以确保从它们的安装目录指定完整路径执行"win_flex"和"bison"命令。这解决了上述问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接