Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:38: error: template argument 1 is invalid
 typedef std::vector<linemod::Template> vector_Template;
                                      ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:38: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:21: error: ‘linemod’ was not declared in this scope
 typedef std::vector<linemod::Feature> vector_Feature;
                     ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:37: error: template argument 1 is invalid
 typedef std::vector<linemod::Feature> vector_Feature;
                                     ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:37: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:25: error: ‘linemod’ was not declared in this scope
 typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
                         ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:42: error: template argument 1 is invalid
 typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
                                          ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:44: error: template argument 1 is invalid
 typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
                                            ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:44: error: template argument 2 is invalid
[100%] Linking CXX executable ../../bin/opencv_perf_tracking
[100%] Built target opencv_perf_tracking
modules/python2/CMakeFiles/opencv_python2.dir/build.make:62: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:15272: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

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

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/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:38: error: template argument 1 is invalid
 typedef std::vector<linemod::Template> vector_Template;
                                      ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:57:38: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:21: error: ‘linemod’ was not declared in this scope
 typedef std::vector<linemod::Feature> vector_Feature;
                     ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:37: error: template argument 1 is invalid
 typedef std::vector<linemod::Feature> vector_Feature;
                                     ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:58:37: error: template argument 2 is invalid
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:25: error: ‘linemod’ was not declared in this scope
 typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
                         ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:42: error: template argument 1 is invalid
 typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
                                          ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:44: error: template argument 1 is invalid
 typedef std::vector<Ptr<linemod::Modality> > vector_Ptr_Modality;
                                            ^
/home/habib/Documents/Projects/Packages/opencv_contrib-3.4/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:44: error: template argument 2 is invalid
[100%] Linking CXX executable ../../bin/opencv_perf_tracking
[100%] Built target opencv_perf_tracking
modules/python2/CMakeFiles/opencv_python2.dir/build.make:62: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:15272: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2