Build for Visual Studio 2015
Hello, Please could you help me - I'm struggling to get going with OpenCV.
I'm having significant difficulties Building OpenCV 3.0.0 for Microsoft Visual Studio 2015 v14.0.24720.00 Following the steps in a tutorial blog, I have used cmake to create a set of build files, and then attempted to build from the solution created. I encounter a series of build errors relating to missing The build errors I have encountered are included here:
C:\fakepath\OpenCV_3_Build Errors.JPG
C:\fakepath\OpenCV_3_Build Errors2.JPG
C:\fakepath\OpenCV_3_Build Errors3.JPG
Please could you give me some advice on whether these could be related to a known issue
Thank you for your help
James
Which version of cmake? Do you try to build opencv_contrib (opencv_extra_modules_path is not empty in cmake)? if yes you must download opencv_contrib too
Hi Thank you for your reply. I'm using Cmake 3.5.0. I am trying to use opencv_contrib and I have downloaded this to a file path and added this path in Cmake next to "OPENCV_EXTRA_MODULES_PATH".
Did you change any other settings? It looks like at least one of the paths or directories is wrong.
So you have download source opencv from github and opencv_contrib too. Is it first error in your first link? (that's better to give full text error message inpost)
Thank you for your replies.
Yes that is correct, I have downloaded OpenCV 3, and contrib, set the source directory in the CMAKE GUI, and created a build directory for the build files. I have changed the setting in CMAKE to add the other modules path, I have set this to where I have downloaded the extra modules to, which is within the OpenCV directory I'm using in CMAKE. I haven't changed any other settings or edited the Cmakelists.txt file.
In the first set of errors, Visual Studio is looking for the file path: opencv2/core/hal/
From the location where CMAKEMakelists.txt is The actual file path is: modules/hal/include/opencv2/hal
I'm not quite sure where this should be corrected, I haven't made any changes to the Makelists file.
Best wishes J
I suggest you to delete cache in CMake file menu and configure and generate again using default parameter and try to build using VS 2015. You will not have opencv_contrib but if it works it's a first step...
I think what you need is to move the opencv_contrib path up one directory. Try LBerger's advice, then this.
Thank you both for your suggestions. I have followed your suggestion of not including the extra contributions. This removes most of the errors, which suggests I am not including the extra code correctly.
I am now down to only two linker errors which relate to the same file:
C2861 operator cv:Matx<double,2,2> identifier not found (compiling source file c:\OpenCV\opencv\sources\modules\core\test\test_mat.cpp)
C2861 operator cv:Matx<double,2,2> no matching overloaded function found (compiling source file c:\OpenCV\opencv\sources\modules\core\test\test_mat.cpp)
Thank you for your help
Which lines? I cannot found it in opencv 3.1
I'm sorry, the lines are both 1597.