NMAKE: fatal error U1077: 'cd': return code '0x2' cl.exe

I am trying to compile QCAD (an open source CAD application that relies on Qt) from the source, so I can create one for msvs2008. I followed the instructions given here: http://www.qcad.org/en/component/content/article/78-qcad/111-qcad-compilation-from-sources .

I was able to successfully configure and compile Qt 4.8.5, and I set the PATH environment variable. I created a new QMAKESPEC environment variable and set the value win-32-msvc2008. I configured QCAD configuration without any problems. However, for about 30 minutes in compilation, I encountered the following error: NMAKE: fatal error U1077: 'cd': return code '0x2'. I saw similar errors for compiling Qt, but I had no problems there. Is there anyone who can understand what might be wrong? Thanks in advance.

Generating Code... c:\qcad\src\3rdparty\qt-labs-qtscriptgenerator-4.8.5\generated_cpp\com_trolltech_qt_webkit\qtscriptshell_qwebpluginfactory.cpp(58) : warning C4715: 'QtScriptShell_QWebPluginFactory::create' : not all control paths return a value c:\qcad\src\3rdparty\qt-labs-qtscriptgenerator-4.8.5\generated_cpp\com_trolltech_qt_webkit\qtscriptshell_qwebpluginfactory.cpp(128) : warning C4715: 'QtScriptShell_QWebPluginFactory::plugins' : not all control paths return a value c:\qcad\src\3rdparty\qt-labs-qtscriptgenerator-4.8.5\generated_cpp\com_trolltech_qt_webkit\qtscriptshell_qwebhistoryinterface.cpp(105) : warning C4715: 'QtScriptShell_QWebHistoryInterface::historyContains' : not all control paths return a value NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.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. C:\qcad> 
+6
source share
1 answer

It took some time, but I solved the problem. The QtScriptShell_QWebPluginFactory.cpp file contained a couple of lines decalizing empty arrays:

 static const QWebPluginFactory::Extension qtscript_QWebPluginFactory_Extension_values[] = {}; static const char * const qtscript_QWebPluginFactory_Extension_keys[] = {}; 

Although this is acceptable for C99, the Visual Studio C ++ compiler does not accept empty arrays. So I just added a nonzero size and the error went away.

 static const QWebPluginFactory::Extension qtscript_QWebPluginFactory_Extension_values[1]; static const char * const qtscript_QWebPluginFactory_Extension_keys[1]; 
+5
source

Source: https://habr.com/ru/post/969760/


All Articles