在編譯google protobuf原碼時出現錯誤

在編譯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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章