Trouble building opencv4.1.1 on RHEL 6
Steps followed:
-> Installed dependancies:python 2.7, python-devel, numpy, matplotlib, cmake, gcc, gcc-c++, tbb, tbb-devel, gtk2-devel, pkgconfig, ffmpeg-devel, gstreamer-plugins-base-devel,
-> Did cmake: [root@sapinjal-lnx build]# cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_PYTHON_SUPPORT=ON ..
-> Did make and it has thrown many errors:
[root@sapinjal-lnx build]# make -j7 ... ...
/localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h: At global scope: /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1895: error: \u2018RepeatedPtrField\u2019 is not a template /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1895: error: \u2018TypeHandler\u2019 in class \u2018google::RepeatedPtrField\u2019 does not name a type /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1896: error: expected unqualified-id before \u2018:\u2019 token /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1900: error: \u2018RepeatedPtrField\u2019 is not a template /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1900: error: \u2018string\u2019 was not declared in this scope /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1900: error: \u2018TypeHandler\u2019 in class \u2018google::RepeatedPtrField\u2019 does not name a type /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1901: error: expected unqualified-id before \u2018:\u2019 token /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1905: error: \u2018google::RepeatedPtrField\u2019 is not a template /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1905: error: declaration of \u2018google::RepeatedPtrField RepeatedPtrField()\u2019 not in a namespace surrounding \u2018::\u2019 /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1905: error: \u2018google::RepeatedPtrField RepeatedPtrField()\u2019 should have been declared inside \u2018::\u2019 /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h: In function \u2018google::RepeatedPtrField google::RepeatedPtrField()\u2019: /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1905: error: return type \u2018struct google::RepeatedPtrField\u2019 is incomplete /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1906: error: only constructors take base initializers /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h: At global scope: /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1909: error: expected initializer before \u2018::\u2019 token /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1913: error: expected initializer before \u2018::\u2019 token /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1921: error: expected initializer before \u2018::\u2019 token /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1933: error: expected constructor, destructor, or type conversion before \u2018::\u2019 token /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1938: error: expected initializer before \u2018&\u2019 token /localdisk/ADRS/opencv-4.1.1/3rdparty/protobuf/src/google/protobuf/repeated_field.h:1948: error: expected initializer before \u2018::\u2019 token /localdisk/ADRS/opencv-4.1.1 ...
Can someone please help me out.