简体   繁体   中英

Building Qt for WinRT using Visual Studio 2013

I downloaded the Qt for Windows Runtime Technology Preview from this location:

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-opensource-src-5.3.0-WinRT-TP\\qtbase-opensource-src-5.3.0-WinRT-TP\\src

The compilation script just looking for win_flex in a directory named gnuwin32. 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). 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-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\\

NOTE 1: Downloading win_flex from sourceforge or add it to the PATH variable does not work! Compilation script searching win_flex hard-coded in the gnuwin32 directory!

NOTE 2: I posted a comment on the official blog post, maybe the guys from Digia will fix the WinRT-TP-Source-Package soon...

I installed win_flex from http://sourceforge.net/projects/winflexbison/

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

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. This fixed the above mentioned problem.

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