OpenPose: неопределенные символы для архитектуры x86_64: libcaffeproto.a (caffe.pb.cc.o) - PullRequest
0 голосов
/ 19 октября 2019

Во время установки openpose устанавливаются зависимости. При создании сборки с использованием - make -j nproc

я получил следующую ошибку:

[  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 ```

1 Ответ

1 голос
/ 21 октября 2019

[Решено]

Это в основном возникало из-за различных версий компиляторов protobuf, как упоминается в CmakeList.txt, и тех, которые доступны.

Если вы столкнулись с этой проблемой, попробуйтеудаление устаревшего.

И даже если он не работает, сделайте это вручную, используя

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