Trying to compile an OpenCV program but getting error LNK2038 in Visual Studio 2012

I followed this tutorial on setting up OpenCV from Visual Studio 2012 and changed all the x86 to x64 links, as well as the tutorial on offer. But when you run the above example code, the following error message appears (in addition to 236 others):

error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in Source.obj c:\Users\user\documents\visual studio 2012\Projects\NewProject\NewProject\opencv_core246d.lib(array.obj) NewProject

I am not sure how to solve this, and other proposed solutions provided for the same error message did not work for me.

+4
source share
1 answer

This error applies to your RunTime Library , you can change this in your project properties:

  • Right-click your project name in Solution Explorer

  • Press C/C++ , then go to Code Generation .

  • Find the section called RunTime Library .

In the drop-down list, you can select several different settings.

Select the option corresponding to the runtime specified in your error, and click "Apply."

You should probably clean and rebuild your project after making these changes.

+6
source

Source: https://habr.com/ru/post/1501822/


All Articles