4

I have added a new cpp file to the existing MSVC++ project (it generates an exe), After adding the particular cpp file (which contains a new main function) i encountered a following error

mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\myproject.dir\Debug\myproject.exe.embed.manifest". The parameter is incorrect.

If i get rid of this newly added file, then the project compiles as it did before the inclusion of the new file,

What can be the reason for this error?

Varo
  • 831
  • 1
  • 7
  • 16
  • is your code have two main functions after adding this new file ? – Jai Jan 28 '14 at 06:13
  • nope, previous main function has been commented out – Varo Jan 28 '14 at 06:15
  • 2
    Try to Clean solution and rebuild it – A B Jan 28 '14 at 06:23
  • And make sure all instances of MyProject.exe have been stopped. Use Task Manager (CTRL+SHIFT+ESC) to validate. – selbie Jan 28 '14 at 06:27
  • Possible duplicate of [mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file ... Access is denied](https://stackoverflow.com/questions/3775406/mt-exe-general-error-c101008d-failed-to-write-the-updated-manifest-to-the-res) – Yochai Timmer Jul 27 '17 at 08:10

2 Answers2

2

Clean the project and rebuild again works for me.

Deqing
  • 14,098
  • 15
  • 84
  • 131
2

It's not a permissions or actual file access problem (AV)...

You can add a flag to make the compiler check the validity of the manifest.

This validation will fix the problem so you'll never have to rebuild it again.
This is very important for anyone who's running an actual Build-Machine or automatic buildscript where you don't want to manually interfere:

Add this flag:
Project properties -> Configuration Properties -> Manifest Tool -> Command Line -> Additional options:

/validate_manifest
Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
Yochai Timmer
  • 48,127
  • 24
  • 147
  • 185