Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-threaded DLL (/MD) vs Multi-threaded (/MT) [duplicate]

My VC++ MFC solution includes four project.

  1. Two project build as DLLs
  2. One project build as Static Lib
  3. One project build as exe with using above three libraries.

I need to host this application without CLR support in windows XP. so I use configuration Use of MFC as Use MFC in a Static Library in all four project.

So my question is what should be the C++-> Code Genaration Configuration for each project.

like image 472
Nayana Adassuriya Avatar asked Mar 21 '26 17:03

Nayana Adassuriya


1 Answers

Use /MD for all your projects. As is stated in the referenced questions: it is important to be consistent. So: even build your Static Lib using /MD, since it will be used in an /MD executable. When you do this, the linker doesn't try to link two different versions of the Microsoft library (static and dynamic) which resolves the error.

like image 77
c_k Avatar answered Mar 24 '26 23:03

c_k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!