Ask Your Question

Linker errors when building in VS2013

asked 2015-12-02 10:34:39 -0500

supergirlx gravatar image

I'm trying to do the sample code from the windows tutorial here:

I did the easy download of OpenCV, which I believe gave me staticlibs instead of DLLs. So, I followed the Visual studio setup as described, but had to point the linker to the statilib dir instead of lib dir to get the lib files.

Now when I build, I get a bunch of these errors:

LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in Source.obj c:\Users\emwakefi\documents\visual studio 2013\Projects\Example 1\Example 1\opencv_core300d.lib(alloc.obj) Example 1

I'm sure that using the static libs is conflicting with some setting, but I'm not sure what I'm doing wrong. Help?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-12-02 12:20:16 -0500

pklab gravatar image

updated 2015-12-03 03:18:26 -0500

In Visual Studio, you have to right select the Runtime Library option in your application project. See below:

Go to Project Property > C/C++ > Code Generation > Runtime Library and set

if you are using OpenCV Dynamic (DLL) Lib

  • Debug Configuration: Multi-threaded Debug DLL (/MDd)
  • Release Configuration: Multi-threaded DLL (/MD)

else, with OpenCV Static Lib

  • Debug Configuration: Multi-threaded Debug (/MTd)
  • Release Configuration: Multi-threaded (/MT)
edit flag offensive delete link more


Thank you! This worked! Now on to the next issue. :)

supergirlx gravatar imagesupergirlx ( 2015-12-02 15:01:21 -0500 )edit

I edited my answer to be more clear for future users. If it works you could accept the answer.

pklab gravatar imagepklab ( 2015-12-03 03:06:32 -0500 )edit

Question Tools

1 follower


Asked: 2015-12-02 10:34:39 -0500

Seen: 228 times

Last updated: Dec 03 '15