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
As other answers explain, exit code 4 may have many causes.
I noticed a case, where resulting path names exceeded the maximum allowed length (just like here).
I have replaced xcopy by robocopy for the affected post build event; robocopy seems to handle paths slightly different and was able to complete the copy task that xcopy was unable to handle.