OpenPose : 未定义的体系结构符号 x86_64: libcaffeproto.a(caffe.pb.cc.o)



在安装openpose期间,正在安装依赖项。 在构建时使用 - 使 -jnproc

我收到以下错误:

[  3%] Built target caffeproto
[  3%] Linking CXX shared library ../../lib/libcaffe.dylib
Undefined symbols for architecture x86_64:
"google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&))", referenced from:
protobuf_caffe_2eproto::AddDescriptorsImpl() in libcaffeproto.a(caffe.pb.cc.o)
"google::protobuf::internal::RegisterAllTypes(google::protobuf::Metadata const*, int)", referenced from:
protobuf_caffe_2eproto::protobuf_RegisterTypes(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libcaffeproto.a(caffe.pb.cc.o)
"google::protobuf::internal::AssignDescriptors(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)", referenced from:
protobuf_caffe_2eproto::protobuf_AssignDescriptors() in libcaffeproto.a(caffe.pb.cc.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [lib/libcaffe.1.0.0.dylib] Error 1
make[4]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [caffe/src/openpose_lib-stamp/openpose_lib-build] Error 2
make[1]: *** [CMakeFiles/openpose_lib.dir/all] Error 2
make: *** [all] Error 2 ```

[已解决]

这基本上是由于 CmakeList 中提到的不同版本的 protobuf 编译器以及可用的版本而引起的.txt。

如果您遇到此问题,请尝试删除过时的问题。

即使它不起作用,也可以使用

protoc src/caffe/proto/caffe.proto --cpp_out=.
mkdir include/caffe/proto
mv src/caffe/proto/caffe.pb.h include/caffe/proto

最新更新