What is going wrong when Visual Studio tells me “xcopy exited with code 4”

后端 未结 16 2116
北荒
北荒 2020-12-05 01:33

I\'m not very familiar with post-build events, so I\'m a little confused as to what\'s going wrong with my program. When compiling in visual studio 2010, I get the following

16条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 02:22

    Xcopy exit code 4 means "Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line."

    It looks like Visual Studio is supplying invalid arguments to xcopy. Check your post-build event command via Project > Right Click > Properties > Build Events > Post Build Event.

    Note that if the $(ProjectDir) or similar macro terms have spaces in the resulting paths when expanded, then they will need to be wrapped in double quotes. For example:

    xcopy "$(ProjectDir)Library\dsoframer.ocx" "$(TargetDir)" /Y /E /D1
    

提交回复
热议问题