简体   繁体   English

使用Visual Studio 2013为WinRT构建Qt

[英]Building Qt for WinRT using Visual Studio 2013

I downloaded the Qt for Windows Runtime Technology Preview from this location: 我从这个位置下载了Qt for Windows Runtime Technology Preview:

http://download.qt-project.org/development_releases/qt/winrt-tp/ http://download.qt-project.org/development_releases/qt/winrt-tp/

When I try to build it using the instructions mentioned here , I eventually run into the following error: 当我尝试使用此处提到的说明构建它时,我最终遇到以下错误:

        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.

How do I fix this? 我该如何解决?

Try this: When you extract the sources, it will have a directory structure like this: 试试这个:当你提取源代码时,它将有一个像这样的目录结构:

.....\\qtbase-opensource-src-5.3.0-WinRT-TP\\qtbase-opensource-src-5.3.0-WinRT-TP\\bin ..... \\ qtbase-开源-SRC-5.3.0-的WinRT-TP \\ qtbase-开源-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-开源-SRC-5.3.0-的WinRT-TP \\ qtbase-开源-SRC-5.3.0-的WinRT-TP的\\ src

The compilation script just looking for win_flex in a directory named gnuwin32. 编译脚本只是在名为gnuwin32的目录中查找win_flex。 This directory and its content can be found at https://qt.gitorious.org/qt/qt5/source/4c925babf9e7f516479a0e418e9b3f509d3cd4b7:gnuwin32 or in the complete Qt5-Sources (WinRT Technology Preview Sources are just a subset). 该目录及其内容可以在https://qt.gitorious.org/qt/qt5/source/4c925babf9e7f516479a0e418e9b3f509d3cd4b7:gnuwin32或完整的Qt5-Sources中找到(WinRT技术预览源只是一个子集)。 Copy this directory to the path, then it should look like this: 将此目录复制到路径,然后它应如下所示:

.....\\qtbase-opensource-src-5.3.0-WinRT-TP\\qtbase-opensource-src-5.3.0-WinRT-TP\\bin ..... \\ qtbase-开源-SRC-5.3.0-的WinRT-TP \\ qtbase-开源-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-开源-SRC-5.3.0-的WinRT-TP \\ qtbase-开源-SRC-5.3.0-的WinRT-TP的\\ src

.....\\qtbase-opensource-src-5.3.0-WinRT-TP\\gnuwin32\\ ..... \\ qtbase-开源-SRC-5.3.0-的WinRT-TP \\的GnuWin32 \\

NOTE 1: Downloading win_flex from sourceforge or add it to the PATH variable does not work! 注意1:从sourceforge下载win_flex或将其添加到PATH变量不起作用! Compilation script searching win_flex hard-coded in the gnuwin32 directory! 编译脚本在gnuwin32目录中搜索win_flex硬编码!

NOTE 2: I posted a comment on the official blog post, maybe the guys from Digia will fix the WinRT-TP-Source-Package soon... 注2:我在官方博客文章上发表了评论,也许Digia的人很快就会修复WinRT-TP-Source-Package ......

I installed win_flex from http://sourceforge.net/projects/winflexbison/ 我从http://sourceforge.net/projects/winflexbison/安装了win_flex

Then in my source, I went to the directory: .....\\qtbase-opensource-src-5.3.0-WinRT-TP\\qtbase-opensource-src-5.3.0-WinRT-TP\\src\\angle\\src\\compiler\\preprocessor 然后在我的源代码中,我进入了目录:..... \\ qtbase-opensource-src-5.3.0-WinRT-TP \\ qtbase-opensource-src-5.3.0-WinRT-TP \\ src \\ angle \\ src \\编译\\预处理

and changed both Makefile.debug and Makefile.release to make sure that "win_flex" and "bison" commands are executed with their full paths specified from their install directories. 并更改了Makefile.debug和Makefile.release以确保“win_flex”和“bison”命令以其安装目录中指定的完整路径执行。 This fixed the above mentioned problem. 这解决了上述问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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