Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to compile QCAD (an open source CAD application which relies on Qt) from the source so I can build it for msvs2008. I've been following the instructions given here: http://www.qcad.org/en/component/content/article/78-qcad/111-qcad-compilation-from-sources.

I've managed to successfully configure and compile Qt 4.8.5 and I set my environment variable PATH. I created a new environment variable QMAKESPEC and set the value to win-32-msvc2008. I completed the configuration of QCAD without any problems. However, about 30 min into the compilation I've run into the following error: NMAKE : fatal error U1077: 'cd' :return code '0x2'. I've seen similar errors reported for the compilation of Qt, however, I had no problem there. Is there anyone who has any idea what may 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>
like image 766
Jays Avatar asked May 23 '14 14:05

Jays


1 Answers

It took a while but I've solved the problem. The file QtScriptShell_QWebPluginFactory.cpp contained a couple of lines decalring empty arrays:

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

Though this is acceptable for C99, the Visual Studio C++ compiler won't accept empty arrays. So I simply added a non-zero size and the error disappeared.

static const QWebPluginFactory::Extension qtscript_QWebPluginFactory_Extension_values[1];
static const char * const qtscript_QWebPluginFactory_Extension_keys[1];
like image 53
Jays Avatar answered Oct 01 '22 09:10

Jays