The difference of C program compile options [`/MD /MDd /MT /MTd`] in visual studio 2022


I am debugging a C program with multiple threads (std=C11). Its Release version runs but cannot output the correct result. But Its Debug version runs right.

I have read few posts on stack-overflow and check it carefully. I find the options [/MD /MDd /MT /MTd] are the key.

  • Its Release version with /MD,/MT goes WRONG.
  • But Its Release version with /MDd,/MTd goes RIGHT.

I think that debug version of multi-threaded dynamic (DLL) runtimes may change something.
But I can not provide a example for it.

How can I solve or avoid this problem? Can you provide a example to explain the difference of them?

Refer Links

Leave a Reply

Your email address will not be published. Required fields are marked *