在編譯google protobuf原碼時出現錯誤
In function `google::protobuf::DescriptorPool::NewPlaceholderWithMutexHeld(std::string const&, google::protobuf::DescriptorPool::PlaceholderType) const':
descriptor.cc:(.text+0xd5db): undefined reference to `google::protobuf::internal::Mutex::AssertHeld()'
undefined reference to `google::protobuf::internal::Mutex::AssertHeld()'
解決方法:
將HAVE_PTHREAD加入CMakeList中
set(CMAKE_CXX_FLAGS "-std=c++11 -DANDROID -DHAVE_PTHREAD ${CMAKE_CXX_FLAGS}")
原理解析:
xxx