2

I have opencv 2.4.6 installed to my machine and want to use it with visual studio 2013 which is also installed.

After doing regular configurations I faced with

1>opencv_core246d.lib(alloc.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800' in main.obj

and many others similar to this error.

I find this question which is similar to my problem. The accepted answer says to me to change opencv but I couldnt find opencv for visual studio 2013. The second answer didn't help at all.

Is there any other way to solve this problem or should I change my visual studio to 2012?

Thanks in advance.

Community
  • 1
  • 1
smttsp
  • 4,011
  • 3
  • 33
  • 62

3 Answers3

2

I was getting the same errors. Are you on a 64-bit machine? I solved the problem by following instructions for installing opencv for 64bit programs.

Check out this tutorial: http://www.anlak.com/using-opencv-2-4-x-with-visual-studio-2010-tutorial/

But it only works if you run the programs in release mode!

joshlk
  • 1,499
  • 3
  • 20
  • 33
  • I have solved the problem, by deleting everything related to visual studio in the machine, then, I re-installed VS2010. I have another machine in which there is a working VS2010. I changed the differences in the command lines under `Properties > C/C++ > CommandLine` and `Properties > Linker > CommandLine`. Then it worked. I had deeply damaged the configurations because of checking a lot of instructions. Thanks by the way. – smttsp Nov 15 '13 at 12:21
2

If you want to use VS2013 with OpenCV you need to use OpenCV 2.4.7.2 (or better). See http://opencv.org/opencv-2-4-7-2-for-windows-release.html

This release contains fixes and improvements mostly in OpenCL-related stuff (‘ocl’ module) and a fix for compilation with VS 2013.

Bull
  • 11,771
  • 9
  • 42
  • 53
1

In visual studio 2013, it should be possible to use the compiler & linker of VS2012 (VC11).
In Configuration Properties > General > Platform Tool Set, do you have v110 in the drop down list? If yes, select it and your executable will be compiled and linked using the tools of VS2012

lolando
  • 1,721
  • 1
  • 18
  • 22
  • No, it doesnt have `v110`, it has `v120(for VS2013), v100(for VS2010), v90(for VS2008)`. – smttsp Oct 19 '13 at 11:41
  • In that case, if you can get opencv compiled with VC100, then you can use VC100 on your side too – lolando Oct 19 '13 at 12:15
  • alternatively, if you install visual studio 2012 express edition, you should be able to select `v110` in your visual studio 2013 (i am not 100% sure though) – lolando Oct 19 '13 at 12:22