QT5.5.1 nmake - unknown flag '-' For usage 错误

QT5.5.1 nmake - unknown flag '-' For usage error

问候语

我正在为 Visual Studio 2010 构建 qt-everywhere-opensource-src-5.5.1,但是当涉及到 nmake 中的 webkit 时,我收到以下错误。

       ( if not exist Makefile.ANGLE.DerivedSources C:\QT-Source\qt-everywhere-opensource-src-5.5.1\qtbase\bin\qmake C:\QT-Source\qt-everywhere-opensource-src-5.5.1\qtwebkit\Source\ThirdParty\ANGLE\DerivedSources.pri -o Makefile.ANGLE.DerivedSources ) && "c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" -f Makefile.ANGLE.DerivedSources

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        flex --noline --nounistd --outfile=generated\glslang_lex.cpp src\compiler\glslang.l
C:\Program Files\GnuWin32\bin\flex.EXE: unknown flag '-'.  For usage, try
        C:\Program Files\GnuWin32\bin\flex.EXE --help
NMAKE : fatal error U1077: '"C:\Program Files\GnuWin32\bin\flex.EXE"' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '(' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

我是这样配置的

configure -debug-and-release -opensource -platform win32-msvc2010 -icu -prefix C:\QT-Compile

这是我的环境变量信息

Environment:
    INCLUDE=
      c:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE
      c:\Program Files\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE
      c:\Program Files\Microsoft SDKs\Windows\v7.0A\include
      C:\Program Files\Microsoft Visual Studio 10.0\VC\include
      C:\Hashemi\Programming\CmpiledForVS2010\icu\include
    LIB=
      c:\Program Files\Microsoft Visual Studio 10.0\VC\LIB
      c:\Program Files\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB
      c:\Program Files\Microsoft SDKs\Windows\v7.0A\lib
      C:\Program Files\Microsoft Visual Studio 10.0\VC\lib
      C:\Hashemi\Programming\CmpiledForVS2010\icu\lib
    PATH=
      c:\Program Files\Microsoft F#\v4.0\
      c:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Deploy
      c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\
      c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN
      c:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools
      c:\Windows\Microsoft.NET\Framework\v4.0.30319
      c:\Windows\Microsoft.NET\Framework\v3.5
      c:\Program Files\Microsoft Visual Studio 10.0\VC\VCPackages
      C:\Program Files\HTML Help Workshop
      c:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Performance Tools
      c:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools
      c:\Program Files\Microsoft SDKs\Windows\v7.0A\bin
      C:\Ruby192\bin
      C:\Perl\site\bin
      C:\Program Files\GnuWin32\bin
      C:\Perl\bin
      C:\Windows\system32
      C:\Windows
      C:\Windows\System32\Wbem
      C:\Windows\System32\WindowsPowerShell\v1.0\
      c:\Program Files\Microsoft SQL Server0\Tools\Binn\
      c:\Program Files\Microsoft SQL Server0\DTS\Binn\
      C:\Python27
      C:\Program Files\CMake 2.8\bin
      C:\QT-Source\qt-everywhere-opensource-src-5.5.1\qtbase
      C:\Hashemi\Programming\CmpiledForVS2010\icu\bin

怎么了?

提前致谢

我下载了 Win flex-bison 并在程序文件和 QT 目录中 GnuWin32\bin 替换了它。错误消失了,感谢 "mlvljr"

然后我得到了新的错误:

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        bison --no-lines --skeleton=yacc.c --defines=generated\glslang_tab.h --output=generated\glslang_tab.cpp src\compiler\glslang.y
'bison' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'bison' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '(' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

为了解决这个问题,我将 Win flex-bison 添加到 Path 环境变量。

我成功完成了 nmake

在我的例子中,我安装了 GnuWin32 文件(C:\Program Files (x86)\GnuWin32\bin):"flex.exe" 和 "bison.exe"(以及那里的其他文件)和"winflex" 个文件 (C:\winflex):"win_flex.exe" 和 "win_bison.exe"。所有这些文件都在 PATH 变量中(设置 PATH=%PATH%;C:\winflex;...)。 为了正确的工作,我做了以下工作:

1) rename C:\Program Files (x86)\GnuWin32\bin\flex.exe to some unused name.

2) rename C:\Program Files (x86)\GnuWin32\bin\bison.exe to some unused name.

3) rename C:\winflex\win_bison.exe to bison.exe.

并修复了 flex 错误。