How Do I Build OpenCV With MS Visual Studio? [closed]

asked 2017-06-05 19:28:45 -0500

reddog gravatar image

I am trying to build OpenCV with MS visual studio 2017, and can't get it to work. Cmake seems to work just fine, but when I build in VS, I get a string of errors. The only file in the BIN directory after build is opencv_cudev320d.dll. Examples of the errors are: MSB6006 "cmd.exe" exited with code 1 opencv_core
and LNK1104 cannot open file "..\lib\debug\opencv_core320d.lib" opencv_ml

This is using the released version 3.2, I got the same results downloading the latest version in GitHub.

Any thoughts as to what I can do to fix this are appreciated.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by LBerger
close date 2017-06-08 00:46:55.132514


try to build only opencv_core in VS 2017

LBerger gravatar imageLBerger ( 2017-06-06 03:07:48 -0500 )edit

OK, after a lot of work unchecking "build" and "with" options, I got it to build opencv_core320d.dll successfully. Now add things back in until it doesn't work?

reddog gravatar imagereddog ( 2017-06-06 20:13:45 -0500 )edit

I don't know what you have done. You can use cmake to build opencv project for vs. When you have got an error build only project with error in VS ( no need to disable anything in cmake) and then you can try to understand what happens : give firs error message in post. When you build opencv with vs it is better to disable cuda (uncheck all modules with cuda).

When build is ok then you can check cuda project

LBerger gravatar imageLBerger ( 2017-06-07 01:11:00 -0500 )edit

I removed all "BUILD" and "WITH" options that involved CUDA, and it worked, so apparently CUDA is the issue. So I can start learning OpenCV, perhaps with less performance, and worry about getting CUDA to work at a later time.

Thank you.

reddog gravatar imagereddog ( 2017-06-07 17:40:57 -0500 )edit