3

I need to compile a code in C++ which has some OpenCV functions and does a kind of test. The fact is that the code has worked in other computers, I just need to set the includes and libraries properly to make it work on my PC.

I get this strange error in release mode when building.

Error: general error c101008d: Failed to write the updated manifest to the resource of file ".\bin\pcTest.exe". The process cannot access the file because it is being used by another process. mt.exe

I found other answers that say mt.exe has to do with the antivirus, or something like that. Anybody knows why is this happening or how can I solve it?

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
  • 1
    `mt.exe` is an application included with the SDK that embeds a manifest into an application. It's not an antivirus application. But *yours* might be interfering: have you configured it with an exclusion for your Visual Studio install directory (and subdirectories) and your code project directories? – Cody Gray - on strike Dec 22 '11 at 12:29
  • Well, the administrator of the company configured it, so I need to check it, but the fact is that I didn't copied this project inside my usual project folder but on desktop. I will try to put it inside the VStudio project folder. – Jav_Rock Dec 22 '11 at 12:34
  • 3
    Anti-malware is 99.99% the reason of this error. Avast is particularly incompatible with VS. Symantec Endpoint has a high suck factor too but is much less consistent in screwing up your build. The other 0.01% is an actual virus trying to mess with the .exe that was just created :) A workaround is to mess with the msbuild .targets file and insert a delay before mt.exe, something you really don't want to do. – Hans Passant Dec 22 '11 at 13:32

2 Answers2

1

I get this error when I try to output the debug version of an executable into a directory that exists in my C:/Program Files (x86) directory. This is a Visual Studio project property I set. (Right click project | Properties | General | Output Directory).

I fixed this issue by temporarily disabling Symantec Endpoint Protection. If your privs don't allow you to do that, you can try outputting the executable somewhere else then copy/pasting it into the desired directory.

dem7w2
  • 146
  • 11
1

Is the .exe file there when you look for it? If so, check whether something else is locking it using LockHunter (http://lockhunter.com). The only time I've had this error is when I've already been running the program and then tried to build it again -- make sure that's not what's happening :)

Stuart Golodetz
  • 20,238
  • 4
  • 51
  • 80