Solving “error d8016 ‘/clr’ and ‘/mtd’ command-line options are incompatible”

When compiling one of my C++ projects, the compiler displayed the error “error d8016 ‘/clr’ and ‘/mtd’ command-line options are incompatible”. I had checked all both the options for “CLR” (Common Language RunTime Support) in “Configuration Properties”->”C/C++”->”General”->”Common Language RunTime Support” and the options for “MTD” (Multi-Threaded Debug) within “Configuration Properties”->”C/C++”->”Code Generation”->”Runtime Library”, the places the compiler complained about. However, I didn’t see anything conflicting options here. CLR was disabled for my project.

After some time, I saw that only one of the files had a different setting. So in case of these errors, and you can’t solve them via the global project properties, check also the properties of the individual files. They might have a different setting!

My problem was solved by going in the project properties to “Configuration Properties”->”C/C++”->”General”->”Common Language RunTime Support” and set it to “No Common Language RunTime support”.

Posted in C++ by Bruno at November 27th, 2012.
Tags: ,

One Response to “Solving “error d8016 ‘/clr’ and ‘/mtd’ command-line options are incompatible””

  1. CUI Jingnan says:

    Great It really help me a lot. thank u .

Leave a Reply