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
Another thing to watch out for is double backslashes, since xcopy
does not tolerate them in the input path parameter (but it does tolerate them in the output path...).
This can also come if the target folder is used by some other processes. Close all the programs which may use the target folder and try.
You may use resource monitor(windows tool) to check the processes which uses your target folder.
This worked for me!.
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
I had the same problem. You could also check which way the slash is pointing. For me it worked to use backslash, instead of forward slash. Example
xcopy /s /y "C:\SFML\bin\*.dll" "$(OutDir)"
Instead of:
xcopy /s /y "C:/SFML/bin/*.dll" "$(OutDir)"