4

I ran into the error [copyResources] Error 4 when trying to build a project I downloaded on a 64 bit Windows 7 install. In the Makefile Qt generates, it contains the following two lines:

copyResources:
    xcopy "D:\Downloads\GraphViz\GraphViz\res" "D:\Downloads\GraphViz\build-GraphViz-Desktop_Qt_5_3_MinGW_32bit-Debug" /e /y 

The make is failing when it hits this target, with the error Invalid number of parameters. I originally assumed a malformed command, but if I run it in command prompt, it works fine. Even stranger, if I copy and paste that exact command into xcopycall.bat and change the Makefile to the following

copyResources:
    xcopycall

then everything works fine. Switching to / doesn't help, so it doesn't appear to be an escaping issue. Why does running it from a batch file as opposed to in a Makefile fix this?

Mike Precup
  • 4,148
  • 21
  • 41
  • Try using "\" instead of single quotes - err, i just took a closer look and there are no spaces, so should actually be fine – Sebastian Lange Oct 23 '14 at 05:52
  • 4
    mingw32-make has the nasty habit of running commands through sh instead of cmd if it can find sh.exe in PATH. Make sure that you don't have it added by cygwin or by git (if you chose the complete unix utility folder to be added to PATH during installation). – jturcotte Oct 23 '14 at 07:30
  • 2
    @jturcotte's comment is the answer. Just add one point that I got from the #qt IRC. Use "where sh" inside CMD on windows to find the location of the sh.exe – lixiang Jan 18 '15 at 22:45

1 Answers1

0

What jturcotte and lixiang said is right, in my case, sh.exe is in the dir C:\Program Files\Git\usr\bin, but removing the dir from Path is undesired, so I commented lines about xcopy in the "GraphViz.pro". It's not elegant, but works :P

simomo
  • 706
  • 10
  • 24