Fatal error when compiling Qt in Windows

2020-02-14 07:41发布

问题:

I tried to build Qt 5.0.1 with MSVS2010 in Windows 7.

These are my steps:

  1. Extract source code into C:\Qt\5.0.1
  2. Start VS2010 command prompt
  3. Type configure (this step took approximately 45 minute)
  4. Type nmake

After an hour I get the following error:

"C:\Program Files (x86)\Microsoft DirectX SDKUtilities\bin\x86\fxc.exe"
/nologo /E standardvs /T vs_2_0 /Fh shaders\standardvs.h ..\..\..\3rdparty\angle
\src\libGLESv2\shaders\Blit.vs

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft DirectX SDKUtiliti
es\bin\x86\fxc.exe' : return code '0x1'
Stop.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.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.

I searched online, and saw many solutions, but none of them solved my problem. I even re-installed Windows and repeated those steps but I got the same error again.

回答1:

You have spaces and parenthesis in your env paths. Try to use short path, you can get them by opening a Windows command prompt with cmd and type dir /X. Short names will be in front of corresponding directories

for example, if you have a script to set up your environment :

SET VISUALDIR=C:\Program Files\Microsoft Visual Studio 9.0
SET PATH=%VISUALDIR%\VC\bin;%PATH%

becomes

SET VISUALDIR=C:\PROGRA~1\MICROS~1.0
SET PATH=%VISUALDIR%\VC\bin;%PATH%

If you have no script, the faulty path could be set in the default Windows PATH environment variable. Then you'll have to manually edit PATH variable and apply short paths here.

windows power