protocol buffers - protobuf common.h "No such file" -
i trying install caffe, , running frustrating error. when run make
following:
cxx .build_release/src/caffe/proto/caffe.pb.cc in file included .build_release/src/caffe/proto/caffe.pb.cc:5:0: .build_release/src/caffe/proto/caffe.pb.h:9:42: fatal error: google/protobuf/stubs/common.h: no such file or directory compilation terminated. make: *** [.build_release/src/caffe/proto/caffe.pb.o] error 1
i using google protocol buffer 2.6.1 (https://developers.google.com/protocol-buffers/docs/downloads), , have indeed added directory path. common.h file there in directory (i see own eyes), somehow unable detect it. have no clue do, , solutions this issue don't seem work me.
any insight appreciated. suspect neglecting step somewhere, rather new linux.
thank much.
path
tells shell search commands. not tell compiler search headers. tell compiler find headers in particular directory, need use -i
flag. example:
g++ -i/path/to/protobuf/include -c my-source.cc
you need convince build system add flag compiler command-line. reasonable build systems have way this, details vary. autoconf can specify when run configure:
./configure cxxflags=-i/path/to/protobuf/include
for cmake think can (not tested):
cmake -dcmake_cxx_flags=-i/path/to/protobuf/include
alternatively, not have problem if installed protobuf standard location -- either /usr
or /usr/local
(hence placing headers in /usr/include/google/protobuf
or /usr/local/include/google/protobuf
).
also note linux distributions have protobuf package, , should use rather installing protobuf source code. need -dev
or -devel
package in order headers. on debian/ubuntu:
sudo apt-get install libprotobuf-dev protobuf-compiler
Comments
Post a Comment