您的位置:首页 > 编程语言 > Qt开发

error MSB6006: "cmd.exe" exited with code 255

2015-08-04 16:31 597 查看
今天尝试编译qwt库,下载源码编译都没有什么问题,但是在编译qwt库自带的example中的程序时出了问题,我这边是用vs2010打开其程序的,在编译的时候有些例子报错: Moc'ing cpuplot.h...1>  命令语法不正确。1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 255.从表象上看应该是执行Moc'ing cpuplot.h...操作时一些命令用错了。网上没找到解决办法,我就自己琢磨了一下,发现cpuplot.vcxproj文件中有一段如下:<pre name="code" class="plain"> <CustomBuild Include="cpuplot.h"><AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath);%(AdditionalInputs)</AdditionalInputs><Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%40echo moc cpuplot.h &&"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DQT_DLL -DQWT_DLL -DQT_NO_KEYWORDS -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include" "-I.\..\..\src" "-I$(QTDIR)\include\ActiveQt" "-I.\moc" "-I$(QTDIR)\mkspecs\default"</Command><Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing cpuplot.h...</Message><Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp;%(Outputs)</Outputs><AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath);%(AdditionalInputs)</AdditionalInputs><Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%40echo moc cpuplot.h &&"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DQT_DLL -DQWT_DLL -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DNDEBUG "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include" "-I.\..\..\src" "-I$(QTDIR)\include\ActiveQt" "-I.\moc" "-I$(QTDIR)\mkspecs\default"</Command><Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing cpuplot.h...</Message><Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp;%(Outputs)</Outputs></CustomBuild>
然后删除%40echo moc cpuplot.h &&这句,问题就解决。感觉应该是qt工程转换到vs工程的时候出了问题,但是还是不了解是什么问题,知道的告诉我下。谢谢。
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Qt visual studio 2010