Important: Please read the Qt Code of Conduct -

Error MSB6006: "cmd.exe" exited with code 3.

  • Hi,

    I'm using a VS project which depends on Qt but when building the project this error is still appearing "

    error MSB6006: "cmd.exe" exited with code 3.
    I've posted a question on msdn forums here but they told me to post a question here as its related to qt build.
    The log file will be found in the same link.

    I've also checked this two questions:


    but couldn't find an answer so if anyone could please help me as this is fairly important and urgent for me?

    Many Thanks in advance for your kind assistance

  • As stated in the msdn thread, the Qt tools rcc/uic/moc cannot be found under the path that is specified (looks rather suspicious from the output ("\bin\moc.exe"), which would mean that you have the moc tool in your project directory, which is probably not the case).
    How do you create the Build rules for moc and co? Are you using the Qt Visual Studio Add-in or are you doing this by hand? If you are using the Add-in, check that the Qt version is correctly set for the project. Also check whether the include and linker directories are correctly set in the project configuration dialog.

  • [quote author="D0IT" date="1364539256"]... (looks rather suspicious from the output ("\bin\moc.exe"), which would mean that you have the moc tool in your project directory, which is probably not the case).[/quote]

    Just a remark, I assume that it is a simple typing error, but the path is not a valid windows path.

  • so, what shall i do now? I need to fix it please.

  • which version of msvc are you using?
    do you have vsaddin installed?

  • visual studio 2010
    windows7 32 bit

  • which Qt version have you installed?
    from where did you download?

  • 5.0.1 from the official website

  • When you have the precompiled build of qt 5.0.1 for msvc 2010 installed, you should have also Qt creator. Did you try to use Qt creator instead?

  • I've opened Qt creator and couldn't find any example in the examples tab!

  • you should be able to go to "File" > "Open File or Project" and navigate to the examples installed. Typically on the Qt installation folder. I have Qt 5 not installed, but I assume it should be there. Go to the folder of one of the examples you like to try, there you should find a file type "Qt Project File". Those are the project files.

  • Hello Sir,
    I have a similar problem. I use Qt 4.8.5, VC 2010. Up till now, I cannot solve my problem. Sorry I still don't understand what you mean. I am a new bie. Could you tell me more detail?

  • QT, error MSB6006 : "cmd.exe" exited with code 3
    I had this stupid error: I was working on a relatively fresh PC (Windows 7 Pro).
    I got rid of this particular error by introducing a QTDIR environment variable (that didn’t exist before):
    Press Windows START button
    Press “Control Panel”
    Press “System”
    Press “Advanced System Settings”
    On the [ADVANCED] tab – press button [Environment Variables] at the bottom
    Under “System Variables”at the bottom – press [NEW]
    Add QTDIR environment variable. In my case that value was “C:\Qt\5.9.1\msvc2017_64” (it has ‘bin’, ‘include’, ‘lib’ directories – the works!).
    I saved this and RESTARTED my computer for better measure (Didn’t seem to “just wok” – at least not for me).
    OK: now I was getting the following error:
    C1083: Cannot open include file: 'stddef.h': No such file or directory
    ...OK what got me out of THIS was:
    [Project] → Properties → Windows SDK version... - I change this from “8.1” to something stupid called “10.0.17134.0” (whatever the hell that means: to me this is all magic).

Log in to reply