0

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.

Nadavp
  • 9
  • 2
  • Does this answer your question? [LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT\_StaticRelease' doesn't match value 'MD\_DynamicRelease' in file.obj](https://stackoverflow.com/questions/28887001/lnk2038-mismatch-detected-for-runtimelibrary-value-mt-staticrelease-doesn) – brc-dd Jul 28 '20 at 06:55
  • Are you sure you're modifying the active build configuration? It's very easy in visual studio to modify the wrong configuration – Alan Birtles Jul 28 '20 at 07:11
  • @brc-dd This the same problem but after tried all the options that suggested there I'm still on the same situation. – Nadavp Jul 28 '20 at 07:24
  • @AlanBirtles Yes I double checked that. – Nadavp Jul 28 '20 at 07:25

1 Answers1

0

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.

Barrnet Chou
  • 1,738
  • 1
  • 4
  • 7