Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Build opencv with opencv_contrib and latest protobuf (3.6.1)

Hi.

I'm trying to build opencv from sources (https://github.com/opencv/opencv > master) with opencv_contrib which I locally cloned. I've prior installed protobuf 3.6.1 (https://github.com/protocolbuffers/protobuf) and caffe (https://github.com/BVLC/caffe) the same way.

But I've got many thousands (!!) of errors like:

/opt/opencv/modules/dnn/misc/caffe/opencv-caffe.pb.cc:33983:30: error: ‘GOOGLE_PREDICT_TRUE’ was not declared in this scope
 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure

ending in:

modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:91: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/misc/caffe/opencv-caffe.pb.cc.o' failed
make[2]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/misc/caffe/opencv-caffe.pb.cc.o] Error 1
CMakeFiles/Makefile2:3756: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/all' failed
make[1]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

So, I wonder how to install opencv (from master branch) with the latest version of protobuf (3.6.1) as well?

Note that I set the Build_Protobuf option to Off during configuration with cmake and make the protobuf libraries pointing directly to the freshly installed ones in /usr/local/.

I also compiled caffe using protobuf 3.6.1 and everything went fine there.

Thanks.

Build opencv with opencv_contrib and latest protobuf (3.6.1)

Hi.

I'm trying to build opencv from sources (https://github.com/opencv/opencv > master) with opencv_contrib which I locally cloned. I've prior installed protobuf 3.6.1 (https://github.com/protocolbuffers/protobuf) and caffe (https://github.com/BVLC/caffe) the same way.

But I've got many thousands (!!) of errors like:

/opt/opencv/modules/dnn/misc/caffe/opencv-caffe.pb.cc:33983:30: error: ‘GOOGLE_PREDICT_TRUE’ was not declared in this scope
 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure

ending in:

modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:91: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/misc/caffe/opencv-caffe.pb.cc.o' failed
make[2]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/misc/caffe/opencv-caffe.pb.cc.o] Error 1
CMakeFiles/Makefile2:3756: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/all' failed
make[1]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

So, I wonder how to install opencv (from master branch) with the latest version of protobuf (3.6.1) as well??

Note that I set the Build_Protobuf option to Off during configuration with cmake and make the protobuf libraries pointing directly to the freshly installed ones in /usr/local/.

I also compiled caffe using protobuf 3.6.1 and everything went fine there.

Thanks.

Build opencv with opencv_contrib and latest protobuf (3.6.1)

Hi.

I'm trying to build opencv from sources (https://github.com/opencv/opencv > master) with opencv_contrib which I locally cloned. I've prior installed protobuf 3.6.1 (https://github.com/protocolbuffers/protobuf) and caffe (https://github.com/BVLC/caffe) the same way.

But I've got many thousands (!!) of errors like:

/opt/opencv/modules/dnn/misc/caffe/opencv-caffe.pb.cc:33983:30: error: ‘GOOGLE_PREDICT_TRUE’ was not declared in this scope
 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure

or

In file included from /opt/opencv/modules/dnn/src/caffe/caffe_io.hpp:98:0,
                 from /opt/opencv/modules/dnn/src/caffe/caffe_importer.cpp:52:
/opt/opencv/modules/dnn/misc/caffe/opencv-caffe.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
  ^~~~~
/opt/opencv/modules/dnn/misc/caffe/opencv-caffe.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^~~~~
/opt/opencv/modules/dnn/misc/caffe/opencv-caffe.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
  ^~~~~

ending in:

modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:91: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/misc/caffe/opencv-caffe.pb.cc.o' failed
make[2]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/misc/caffe/opencv-caffe.pb.cc.o] Error 1
CMakeFiles/Makefile2:3756: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/all' failed
make[1]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

So, I wonder how to install opencv (from master branch) with the latest version of protobuf (3.6.1) ?

Note that I set the Build_Protobuf option to Off during configuration with cmake and make the protobuf libraries pointing directly to the freshly installed ones in /usr/local/.

I also compiled caffe using protobuf 3.6.1 and everything went fine there.

Thanks.