Project compile with MDd even when setting to MTd

396 Views Asked by At

I'm trying to compile an exe that depends on some other static projects. Some of the projects depends on OpenCV libraries that compiled with MTd runtime library option. What I did is to set the runtime library of all my projects to MTd (in the runtime library option on visual studio project's properties) as well. When I compile only the static projects everything going well, but when I compile the exe file I get an error like this:

Transform_Static.lib (Transform.obj : error LNK2038: mismatch detected for 'Runtime Library' value 'MDd_DynamicDebug' dosen't match value 'MTd_StaticDebug' in Math_UT.obj

I tried to add/remove libs from the linker dependencies of the exe project but nothing change, what else can I do? thanks.

1

There are 1 best solutions below

0
Barrnet Chou On

First, You could check if Runtime Library is MTd.

Then, you could clean the project and rebuild the project.

Also, you could refer to Microsoft Docs about LNK2038 and the similar question.