我已在MacOS上成功安装了protobuf,但是在git存储库中运行示例时,我收到一些错误,但下面仅显示一个。
make cpp
pkg-config --cflags protobuf # fails if protobuf is not installed
-pthread -I/usr/local/include
c++ add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf`
In file included from add_person.cc:5:
In file included from /usr/local/include/google/protobuf/util/time_util.h:45:
In file included from /usr/local/include/google/protobuf/duration.pb.h:23:
In file included from /usr/local/include/google/protobuf/io/coded_stream.h:135:
/usr/local/include/google/protobuf/stubs/common.h:190:17: error: expected expression
OnShutdownRun([](const void* pp) { delete static_cast<const T*>(pp); }, p);
^
但是,当我在ubuntu桌面上安装protobuf时,示例可以是make
并正确执行。