Ask Your Question
0

Fail to manually build opencv4.1.0 on centos6

asked 2019-04-25 02:42:08 -0600

I want to generate libopencv_java410.so for my project.

I reference to this link: https://docs.opencv.org/4.1.0/d7/d9f/... .

After I execute 'cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF ..', it seems ok.

And then I execute 'make', things go wrong on libprotobuf. The command line errors are:

Scanning dependencies of target libprotobuf
[ 23%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/arena.cc.o
[ 23%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/arenastring.cc.o
[ 23%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/extension_set.cc.o
In file included from /home/meicheng/tools/opencv-4.1.0/3rdparty/protobuf/src/google/protobuf/repeated_field.h:62,
                 from /home/meicheng/tools/opencv-4.1.0/3rdparty/protobuf/src/google/protobuf/extension_set.h:51,
                 from /home/meicheng/tools/opencv-4.1.0/3rdparty/protobuf/src/google/protobuf/extension_set.cc:38:
/home/meicheng/tools/opencv-4.1.0/3rdparty/protobuf/src/google/protobuf/message_lite.h:116: error: expected ‘;’ before ‘const’
/home/meicheng/tools/opencv-4.1.0/3rdparty/protobuf/src/google/protobuf/message_lite.h:120: error: expected ‘;’ before ‘T’
/home/meicheng/tools/opencv-4.1.0/3rdparty/protobuf/src/google/protobuf/message_lite.h: In function ‘const std::string& google::protobuf::internal::GetEmptyStringAlreadyInited()’:
/home/meicheng/tools/opencv-4.1.0/3rdparty/protobuf/src/google/protobuf/message_lite.h:139: error: ‘class google::protobuf::internal::ExplicitlyConstructed<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >’ has no member named ‘get’

I wonder why this happens. My cmake version is 3.14.3. My gcc version is 4.4.6 Thanks in advance.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2019-04-28 02:50:55 -0600

berak gravatar image

My gcc version is 4.4.6

that's probably way too old (it does not know c++11 out-of-the-box)

you can try to use cmake -ENABLE_CXX11=ON, but in the long run, you'll have to update your compiler / os.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-04-25 02:42:08 -0600

Seen: 355 times

Last updated: Apr 25 '19