Opencv contrib modules on VS15
Hi!
I have been trying to build the opencv_contrib module for OpenCV 3.1 on Visual Studio 15. These are the steps I've done so far:
1) Downloaded the OpenCV 3.1 from http://opencv.org/downloads.html and extracted the content to my chosen directory (C:\opencv).
2) Cloned the opencv_contrib repository from here https://github.com/opencv/opencv_contrib and chosen a directory for it (C:\opencv_contrib)
3) I tried running the Cmake GUI from standard command line using admin rights. I chose the VS15 as generator for this.
It got me this error:
Here it seems to me that Cmake is unable to find the VS C++ compiler, and thus is unable to generate the build. To fix this i tried running the cmake-gui from the developer command line for VS15.
This seemed to have done the trick.
I wrote in the path for the OPENCV_EXTRA_MODULES_PATH:
I also ticked OFF the opencv_aruco module as I know it causes problems with my current project.
After this i hit "configure" and let Cmake run. It does this with no error. I then hit "generate" and let it finish. All still good.
4) I then opened the created OpenCV.sln project in the C:\opencv\build folder in VS.
5) I then tried to build the ALL_BUILD and INSTALL project files and get this error output for the building the debug solution of ALL_BUILD:
It seems here to me that the problem lies in Cmake trying to generate a 32bit solution, while VS15 expects a 64bit solution. I have no idea how this happens! Any help would be appreciated!
I don't do like this. I use cmake gui and select vs 14 2015 win 64 and press configure. then in name "OPENCV" I fill OPENCV_EXTRA_MODULES_PATH with my path to opencvçcontrib : f:/lib/opencv_contrib/modules press generate and open sln project with VS 2015
I have tried exactly what you say as well, but if I try to use the win64 compiler it just results in hundreds of errors when I try to build ALL_BUILD and INSTALL in OpenCV.sln...
can you post errors? Do you succeed to build opencv with cmake and vs2015?
please get github master, not the prebuild 3.1 binaries(they're too old)
Hi, i encountered the same problem as well. I received lots of errors when i try to "built" the OpenCV.sln. Are there any working solutions? I am using OpenCV3.1.0 (downloaded from the official website), using VS2015 update 3, latest CMake version
like berak said don't use precompiled binaries opencv. Opencv_contrib is build using opencv master from github not with opencv binaries. You must follow readme to build it
LBerger, I had tried using the Opencv_contrib using opencv master from Github, but when i try to built it in VS 2015, the results is
Build: 11 succeeded, 133 failed, 1 up-to-date, 0 skipped
Most of the errors are like this
LINK : fatal error LNK1104: cannot open file '....\lib\Debug\opencv_objdetect310d.lib'
All the lib are failed to be linked. Is there anything i did wrongly during the installation?
Dear all, my problem had been solved. Just by disable WITH_CUDA during the CMAKE configuration, then the OpenCV.sln can be built successfully without any errors. But just one question, if CUDA is disabled, how can i use GPU to run for my project if needed?
I have now updated the original post with screenshots and a more understandable project text. I'll try to do this with the opencv-master branch now and see if this gets any better results. I will also try ticking OFF the WITH_CUDA during Cmake config. Thanks for the answers guys, lets hope something works!
@ThorbjornSomod don't use vs 2015 in cmake but visual studio 14 2015 win64. Don't forget to delete cache in cmake and Have you downloaded opencv from github?