I get build error while building OpenCV and OpenCV_Contrib from the source on Linux [closed]

asked 2018-09-13 02:18:09 -0500

khaalidi gravatar image

I'm building OpenCV on Linux with OpenCV_contrib and I can't make it work. OpenCV alone can build with no errors.

cmake -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4/modules ..

$ make j5

During make process , it fails at 100% ,đŸ˜”đŸ˜”đŸ˜”đŸ˜”đŸ˜”đŸ˜”đŸ˜”đŸ˜”

[100%] Building CXX object modules/stitching/CMakeFiles/opencv_perf_stitching.dir/perf/perf_matchers.cpp.o
Scanning dependencies of target opencv_perf_tracking
[100%] Building CXX object modules/tracking/CMakeFiles/opencv_perf_tracking.dir/perf/perf_main.cpp.o
[100%] Building CXX object modules/tracking/CMakeFiles/opencv_perf_tracking.dir/perf/perf_Tracker.cpp.o
[100%] Linking CXX executable ../../bin/opencv_test_tracking
[100%] Built target opencv_test_tracking
Scanning dependencies of target opencv_python2
[100%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o
[100%] Linking CXX executable ../../bin/opencv_perf_stitching
[100%] Built target opencv_perf_stitching
In file included from /home/habib/Documents/Projects/Packages/opencv-3.4.3/build/modules/python_bindings_generator/pyopencv_custom_headers.h:8:0,
                 from /home/habib/Documents/Projects/Packages/opencv-3.4.3/modules/python/src2/cv2.cpp:1816:
/home/habib/Documents/Projects/Packages/opencv_contrib-

3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:4:40: error: ‘linemod’ was not declared in this scope
 template<> struct pyopencvVecConverter<linemod::Match>
                                        ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:4:54: error: template argument 1 is invalid
 template<> struct pyopencvVecConverter<linemod::Match>
                                                      ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:17:40: error: ‘linemod’ was not declared in this scope
 template<> struct pyopencvVecConverter<linemod::Template>
                                        ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:17:57: error: template argument 1 is invalid
 template<> struct pyopencvVecConverter<linemod::Template>
                                                         ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:30:40: error: ‘linemod’ was not declared in this scope
 template<> struct pyopencvVecConverter<linemod::Feature>
                                        ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:30:56: error: template argument 1 is invalid
 template<> struct pyopencvVecConverter<linemod::Feature>
                                                        ^
/home/habib/Documents/Projects/Packages/opencv_contrib-

3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:43:44: error: ‘linemod’ was not declared in this scope
 template<> struct pyopencvVecConverter<Ptr<linemod::Modality> >
                                            ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:43:61: error: template argument 1 is invalid
 template<> struct pyopencvVecConverter<Ptr<linemod::Modality> >
                                                             ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:43:63: error: template argument 1 is invalid
 template<> struct pyopencvVecConverter<Ptr<linemod::Modality> >
                                                               ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:56:21: error: ‘linemod’ was not declared in this scope
 typedef std::vector<linemod::Match> vector_Match;
                     ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:56:35: error: template argument 1 is invalid
 typedef std::vector<linemod::Match> vector_Match;
                                   ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:56:35: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:21: error: ‘linemod’ was not declared in this scope
 typedef std::vector<linemod::Template> vector_Template;
                     ^
/home/habib/Documents/Projects/Packages ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2018-09-14 02:35:39.627569

Comments

please use the exact same version for both opencv main and opencv_contrib, e.g like:

git clone -b 3.4 https://github.com/opencv/opencv
git clone -b 3.4 https://github.com/opencv/opencv_contrib
berak gravatar imageberak ( 2018-09-13 05:18:00 -0500 )edit
1

Thanks Buddy! It worked..

Before this I downloaded the OpenCV Source code from the official website and Cloned the OpenCV_Contrib from Github.

khaalidi gravatar imagekhaalidi ( 2018-09-14 02:30:12 -0500 )edit