简体   繁体   中英

using opencv with visual studio 2013

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.

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!

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM