在编译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