-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
2.1.2
-
None
-
MS Visual Studio 15.4.0
Qt 5.9.2 msvc2017_64
The vcxproj file will have a syntax error for any moc command after a project has been opened using the Open Qt Project File (.pro) menu option. If you open up the vcxproj file you will see the Command:
%40echo moc objectheader.h &&
"$(QTDIR)\bin\moc.exe" ...
The issue is that there is a \r\n at the end of the first line, and when it is put into a command prompt you get:
C:\> @echo moc objectheader.h && The syntax of the command is incorrect. C:\>
It looks like src/qtprojectlib/MocCmdChecker.cs tries to compensate for it in the method SplitIntoCommands on line 115 (snippet below) but it only searches for "&&" and not "&&"
private static string[] SplitIntoCommands(string cmdLine) { var cmds = cmdLine.Split(new[] { "&&", "\r\n" }, StringSplitOptions.RemoveEmptyEntries); var res = new string[cmds.Length]; for (var i = 0; i < cmds.Length; ++i) res[i] = cmds[i].Trim(); return res; }
The workaround for now is to either delete the "&&" from the end of that line (which looks like the intention of the last code snippet) or replace the \r\n with a space.