You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/07/13 08:34:29 UTC

[GitHub] [incubator-brpc] ruoshui1314 opened a new issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

ruoshui1314 opened a new issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159


   **Describe the bug (描述bug)**
   1.build brpc successfully
   2.fail to build echo_c++ in example.details as follow:
   
   `31 warnings generated.
   [ 25%] Linking CXX executable echo_server
   Undefined symbols for architecture x86_64:
     "_BN_get_rfc2409_prime_1024", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
         brpc::policy::DHWrapper::do_initialize() in libbrpc.a(dh.cpp.o)
     "_BN_get_rfc3526_prime_2048", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
     "_BN_get_rfc3526_prime_4096", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
     "_BN_get_rfc3526_prime_8192", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
     "_DH_get0_key", referenced from:
         brpc::policy::DHWrapper::initialize(bool) in libbrpc.a(dh.cpp.o)
         brpc::policy::DHWrapper::copy_public_key(char*, int*) const in libbrpc.a(dh.cpp.o)
     "_DH_set0_pqg", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
   `
   
   
   
   **To Reproduce (复现方法)**
   ------------
   environment is MAC OS 10.14.5
   1. build dependencies such as leveldb, glog in local
   2. move ssl headers and library to local directory
   3. build brpc successfully
   `cd incubator-brpc-0.9.7
   mkdir build
   cd build
   cmake -DCMAKE_INCLUDE_PATH="/xxx/local/include" -DCMAKE_LIBRARY_PATH="/xxx/local/lib" -DCMAKE_INSTALL_PREFIX=/xxx/local  --with-glog  ..`
   
   4. fail to build example
   
   `cd example/echo_c++
   mkdir build
   cd build
   cmake -DCMAKE_INCLUDE_PATH="/xxx/local/include" -DCMAKE_LIBRARY_PATH="/xxx/local/lib"  --with-glog  ..`
   
   error
   
   **Expected behavior (期望行为)**
   build successfully
   
   **Versions (各种版本)**
   OS:macos 10.14.5
   Compiler:
    g++ -v
   Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
   Apple LLVM version 10.0.1 (clang-1001.0.46.4)
   Target: x86_64-apple-darwin18.6.0
   Thread model: posix
   InstalledDir: /Library/Developer/CommandLineTools/usr/bin
   brpc: 0.9.7
   protobuf: protobuf-3.5.0.1
   
   **Additional context/screenshots (更多上下文/截图)**
   
   /xxx/local/include/google/protobuf/message.h:321:16: note: overridden virtual function is here
     virtual void SetCachedSize(int size) const;
                  ^
   31 warnings generated.
   [ 25%] Linking CXX executable echo_server
   Undefined symbols for architecture x86_64:
     "_BN_get_rfc2409_prime_1024", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
         brpc::policy::DHWrapper::do_initialize() in libbrpc.a(dh.cpp.o)
     "_BN_get_rfc3526_prime_2048", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
     "_BN_get_rfc3526_prime_4096", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
     "_BN_get_rfc3526_prime_8192", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
     "_DH_get0_key", referenced from:
         brpc::policy::DHWrapper::initialize(bool) in libbrpc.a(dh.cpp.o)
         brpc::policy::DHWrapper::copy_public_key(char*, int*) const in libbrpc.a(dh.cpp.o)
     "_DH_set0_pqg", referenced from:
         brpc::SSLDHInit() in libbrpc.a(ssl_helper.cpp.o)
         brpc::policy::DHWrapper::do_initialize() in libbrpc.a(dh.cpp.o)
     "_OPENSSL_init_ssl", referenced from:
         brpc::GlobalInitializeOrDieImpl() in libbrpc.a(global.cpp.o)
     "_OPENSSL_sk_num", referenced from:
         brpc::ExtractHostnames(x509_st*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in libbrpc.a(ssl_helper.cpp.o)
     "_OPENSSL_sk_pop_free", referenced from:
         brpc::ExtractHostnames(x509_st*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in libbrpc.a(ssl_helper.cpp.o)
     "_OPENSSL_sk_value", referenced from:
         brpc::ExtractHostnames(x509_st*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in libbrpc.a(ssl_helper.cpp.o)
     "_SSL_CTX_set_options", referenced from:
         brpc::SetSSLOptions(ssl_ctx_st*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, brpc::VerifyOptions const&) in libbrpc.a(ssl_helper.cpp.o)
     "_X509_getm_notAfter", referenced from:
         brpc::Print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, x509_st*, char const*) in libbrpc.a(ssl_helper.cpp.o)
     "_X509_getm_notBefore", referenced from:
         brpc::Print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, x509_st*, char const*) in libbrpc.a(ssl_helper.cpp.o)
     "fLI::FLAGS_v", referenced from:
         brpc::Server::BuildAcceptor() in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         brpc::Server::RemoveService(google::protobuf::Service*) in libbrpc.a(server.cpp.o)
         brpc::ParseRestfulPath(butil::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, brpc::RestfulMethodPath*) in libbrpc.a(restful.cpp.o)
         brpc::RestfulMap::AddMethod(brpc::RestfulMethodPath const&, google::protobuf::Service*, brpc::Server::MethodProperty::OpaqueParams const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, brpc::MethodStatus*) in libbrpc.a(restful.cpp.o)
         brpc::RestfulMap::PrepareForFinding() in libbrpc.a(restful.cpp.o)
         brpc::RestfulMap::FindMethodProperty(butil::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) const in libbrpc.a(restful.cpp.o)
         ...
     "google::LogMessage::stream()", referenced from:
         _main in server.cpp.o
         example::EchoServiceImpl::Echo(google::protobuf::RpcController*, example::EchoRequest const*, example::EchoResponse*, google::protobuf::Closure*) in server.cpp.o
         brpc::Server::UpdateDerivedVars(void*) in libbrpc.a(server.cpp.o)
         brpc::Socket::Address(unsigned long long, std::__1::unique_ptr<brpc::Socket, brpc::SocketDeleter>*) in libbrpc.a(server.cpp.o)
         brpc::Server::Stop(int) in libbrpc.a(server.cpp.o)
         brpc::Server::Join() in libbrpc.a(server.cpp.o)
         brpc::Server::ClearServices() in libbrpc.a(server.cpp.o)
         ...
     "google::LogMessage::SendToLog()", referenced from:
         brpc::Server::UpdateDerivedVars(void*) in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         butil::iobuf::get_pwritev_func() in libbrpc.a(iobuf.cpp.o)
         butil::iobuf::get_preadv_func() in libbrpc.a(iobuf.cpp.o)
         brpc::Controller::NotifyOnCancel(google::protobuf::Closure*) in libbrpc.a(controller.cpp.o)
         brpc::FileChecksum(char const*, unsigned char*) in libbrpc.a(common.cpp.o)
         brpc::InputMessenger::OnNewMessages(brpc::Socket*) in libbrpc.a(input_messenger.cpp.o)
         ...
     "google::LogMessage::LogMessage(char const*, int)", referenced from:
         example::EchoServiceImpl::Echo(google::protobuf::RpcController*, example::EchoRequest const*, example::EchoResponse*, google::protobuf::Closure*) in server.cpp.o
         brpc::Server::Stop(int) in libbrpc.a(server.cpp.o)
         brpc::Server::BuildAcceptor() in libbrpc.a(server.cpp.o)
         brpc::Server::StartInternal(in_addr const&, brpc::PortRange const&, brpc::ServerOptions const*) in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         brpc::Server::RemoveService(google::protobuf::Service*) in libbrpc.a(server.cpp.o)
         brpc::ParseRestfulPath(butil::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, brpc::RestfulMethodPath*) in libbrpc.a(restful.cpp.o)
         ...
     "google::LogMessage::LogMessage(char const*, int, int)", referenced from:
         _main in server.cpp.o
         brpc::Server::UpdateDerivedVars(void*) in libbrpc.a(server.cpp.o)
         brpc::Server::ClearServices() in libbrpc.a(server.cpp.o)
         brpc::Server::AddBuiltinServices() in libbrpc.a(server.cpp.o)
         brpc::Server::BuildAcceptor() in libbrpc.a(server.cpp.o)
         brpc::Server::InitializeOnce() in libbrpc.a(server.cpp.o)
         butil::FlatMap<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, brpc::Server::ServiceProperty, butil::DefaultHasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, butil::DefaultEqualTo<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, false>::init(unsigned long, unsigned int) in libbrpc.a(server.cpp.o)
         ...
     "google::LogMessage::LogMessage(char const*, int, int, int, void (google::LogMessage::*)())", referenced from:
         brpc::policy::DiscoveryNamingService::GetServers(char const*, std::__1::vector<brpc::ServerNode, std::__1::allocator<brpc::ServerNode> >*) in libbrpc.a(discovery_naming_service.cpp.o)
         brpc::policy::adobe_hs::openssl_HMACsha256(void const*, int, void const*, int, void*) in libbrpc.a(rtmp_protocol.cpp.o)
         brpc::policy::ConsulNamingService::GetServers(char const*, std::__1::vector<brpc::ServerNode, std::__1::allocator<brpc::ServerNode> >*) in libbrpc.a(consul_naming_service.cpp.o)
         bthread::allocate_stack_storage(bthread::StackStorage*, int, int) in libbrpc.a(stack.cpp.o)
     "google::LogMessage::~LogMessage()", referenced from:
         _main in server.cpp.o
         example::EchoServiceImpl::Echo(google::protobuf::RpcController*, example::EchoRequest const*, example::EchoResponse*, google::protobuf::Closure*) in server.cpp.o
         brpc::Server::UpdateDerivedVars(void*) in libbrpc.a(server.cpp.o)
         brpc::Server::Stop(int) in libbrpc.a(server.cpp.o)
         brpc::Server::ClearServices() in libbrpc.a(server.cpp.o)
         brpc::Server::AddBuiltinServices() in libbrpc.a(server.cpp.o)
         brpc::Server::BuildAcceptor() in libbrpc.a(server.cpp.o)
         ...
     "google::InitVLOG3__(int**, int*, char const*, int)", referenced from:
         brpc::Server::BuildAcceptor() in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         brpc::Server::RemoveService(google::protobuf::Service*) in libbrpc.a(server.cpp.o)
         brpc::ParseRestfulPath(butil::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, brpc::RestfulMethodPath*) in libbrpc.a(restful.cpp.o)
         brpc::RestfulMap::AddMethod(brpc::RestfulMethodPath const&, google::protobuf::Service*, brpc::Server::MethodProperty::OpaqueParams const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, brpc::MethodStatus*) in libbrpc.a(restful.cpp.o)
         brpc::RestfulMap::PrepareForFinding() in libbrpc.a(restful.cpp.o)
         brpc::RestfulMap::FindMethodProperty(butil::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) const in libbrpc.a(restful.cpp.o)
         ...
     "google::ErrnoLogMessage::ErrnoLogMessage(char const*, int, int, int, void (google::LogMessage::*)())", referenced from:
         brpc::Server::UpdateDerivedVars(void*) in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         butil::iobuf::get_pwritev_func() in libbrpc.a(iobuf.cpp.o)
         butil::iobuf::get_preadv_func() in libbrpc.a(iobuf.cpp.o)
         brpc::Controller::NotifyOnCancel(google::protobuf::Closure*) in libbrpc.a(controller.cpp.o)
         brpc::FileChecksum(char const*, unsigned char*) in libbrpc.a(common.cpp.o)
         brpc::InputMessenger::OnNewMessages(brpc::Socket*) in libbrpc.a(input_messenger.cpp.o)
         ...
     "google::ErrnoLogMessage::~ErrnoLogMessage()", referenced from:
         brpc::Server::UpdateDerivedVars(void*) in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         butil::iobuf::get_pwritev_func() in libbrpc.a(iobuf.cpp.o)
         butil::iobuf::get_preadv_func() in libbrpc.a(iobuf.cpp.o)
         brpc::Controller::NotifyOnCancel(google::protobuf::Closure*) in libbrpc.a(controller.cpp.o)
         brpc::FileChecksum(char const*, unsigned char*) in libbrpc.a(common.cpp.o)
         brpc::InputMessenger::OnNewMessages(brpc::Socket*) in libbrpc.a(input_messenger.cpp.o)
         ...
     "google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from:
         brpc::Socket::Address(unsigned long long, std::__1::unique_ptr<brpc::Socket, brpc::SocketDeleter>*) in libbrpc.a(server.cpp.o)
         brpc::thread_local_data() in libbrpc.a(server.cpp.o)
         bvar::detail::Series<long long, bvar::detail::AddTo<long long> >::describe(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*) const in libbrpc.a(server.cpp.o)
         bvar::detail::Series<timeval, bvar::PassiveStatus<timeval>::PlaceHolderOp>::describe(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*) const in libbrpc.a(server.cpp.o)
         bvar::detail::Series<int, bvar::detail::AddTo<int> >::describe(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*) const in libbrpc.a(server.cpp.o)
         butil::DoublyBufferedData<brpc::Server::CertMaps, butil::Void>::DoublyBufferedData() in libbrpc.a(server.cpp.o)
         butil::iobuf::release_tls_block_chain(butil::IOBuf::Block*) in libbrpc.a(iobuf.cpp.o)
         ...
     "google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)", referenced from:
         brpc::Socket::Address(unsigned long long, std::__1::unique_ptr<brpc::Socket, brpc::SocketDeleter>*) in libbrpc.a(server.cpp.o)
         brpc::Server::Join() in libbrpc.a(server.cpp.o)
         brpc::Server::StartInternal(in_addr const&, brpc::PortRange const&, brpc::ServerOptions const*) in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         brpc::thread_local_data() in libbrpc.a(server.cpp.o)
         unsigned long butil::DoublyBufferedData<brpc::Server::CertMaps, butil::Void>::Modify<bool (brpc::Server::CertMaps&)>(bool (&)(brpc::Server::CertMaps&)) in libbrpc.a(server.cpp.o)
         unsigned long butil::DoublyBufferedData<brpc::Server::CertMaps, butil::Void>::Modify<butil::DoublyBufferedData<brpc::Server::CertMaps, butil::Void>::Closure1<bool (brpc::Server::CertMaps&, brpc::Server::SSLContext const&), brpc::Server::SSLContext> >(butil::DoublyBufferedData<brpc::Server::CertMaps, butil::Void>::Closure1<bool (brpc::Server::CertMaps&, brpc::Server::SSLContext const&), brpc::Server::SSLContext>&) in libbrpc.a(server.cpp.o)
         ...
     "google::LogMessageFatal::~LogMessageFatal()", referenced from:
         brpc::Socket::Address(unsigned long long, std::__1::unique_ptr<brpc::Socket, brpc::SocketDeleter>*) in libbrpc.a(server.cpp.o)
         brpc::Server::Join() in libbrpc.a(server.cpp.o)
         brpc::Server::StartInternal(in_addr const&, brpc::PortRange const&, brpc::ServerOptions const*) in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         brpc::thread_local_data() in libbrpc.a(server.cpp.o)
         unsigned long butil::DoublyBufferedData<brpc::Server::CertMaps, butil::Void>::Modify<bool (brpc::Server::CertMaps&)>(bool (&)(brpc::Server::CertMaps&)) in libbrpc.a(server.cpp.o)
         bvar::detail::Series<long long, bvar::detail::AddTo<long long> >::describe(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*) const in libbrpc.a(server.cpp.o)
         ...
     "google::kLogSiteUninitialized", referenced from:
         brpc::Server::BuildAcceptor() in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded() in libbrpc.a(server.cpp.o)
         brpc::Server::RemoveService(google::protobuf::Service*) in libbrpc.a(server.cpp.o)
         brpc::Server::BuildAcceptor()::vlocal__ in libbrpc.a(server.cpp.o)
         brpc::Server::RemoveService(google::protobuf::Service*)::vlocal__ in libbrpc.a(server.cpp.o)
         brpc::Server::PutPidFileIfNeeded()::vlocal__ in libbrpc.a(server.cpp.o)
         brpc::ParseRestfulPath(butil::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, brpc::RestfulMethodPath*) in libbrpc.a(restful.cpp.o)
         ...
     "void google::MakeCheckOpValueString<char>(std::__1::basic_ostream<char, std::__1::char_traits<char> >*, char const&)", referenced from:
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<char, int>(char const&, int const&, char const*) in libbrpc.a(rtmp_protocol.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<char, int>(char const&, int const&, char const*) in libbrpc.a(rtmp.cpp.o)
     "google::base::CheckOpMessageBuilder::ForVar2()", referenced from:
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned int, unsigned int>(unsigned int const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned int>(unsigned long const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long long, unsigned long long>(unsigned long long const&, unsigned long long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, long>(int const&, long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(iobuf.cpp.o)
         ...
     "google::base::CheckOpMessageBuilder::NewString()", referenced from:
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned int, unsigned int>(unsigned int const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned int>(unsigned long const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long long, unsigned long long>(unsigned long long const&, unsigned long long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, long>(int const&, long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(iobuf.cpp.o)
         ...
     "google::base::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)", referenced from:
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned int, unsigned int>(unsigned int const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned int>(unsigned long const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long long, unsigned long long>(unsigned long long const&, unsigned long long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, long>(int const&, long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(iobuf.cpp.o)
         ...
     "google::base::CheckOpMessageBuilder::~CheckOpMessageBuilder()", referenced from:
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned int, unsigned int>(unsigned int const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned int>(unsigned long const&, unsigned int const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long long, unsigned long long>(unsigned long long const&, unsigned long long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, long>(int const&, long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*) in libbrpc.a(server.cpp.o)
         std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in libbrpc.a(iobuf.cpp.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[2]: *** [echo_server] Error 1
   make[1]: *** [CMakeFiles/echo_server.dir/all] Error 2
   make: *** [all] Error 2
   
   
   how can I solve it or any other suggestions ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] critical27 edited a comment on issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

Posted by GitBox <gi...@apache.org>.
critical27 edited a comment on issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159#issuecomment-851781004


   Still failed on macos big sur 11.3.1, it will fail if `--with-glog`. Will work if no `--with-glog` is added. Perhaps glog need to build a static lib.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] ruoshui1314 edited a comment on issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

Posted by GitBox <gi...@apache.org>.
ruoshui1314 edited a comment on issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159#issuecomment-657433936


   update:
   It could be builded successfully when using master branch.
   The command is:
   
   `
   sh config_brpc.sh --headers="/xxx/local/include /usr/local/include" --libs="/xxx/local/lib /usr/local/lib /xxx/local/bin" --cc=clang --cxx=clang++
   
   `
   and building example is correct.
   
   
   but fail to build 0.9.7 brpc library.
   The detail errors :
   
   
   Linking protoc-gen-mcpack
   Undefined symbols for architecture x86_64:
     "fLI::FLAGS_v", referenced from:
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::TaskControl::worker_thread(void*) in libbrpc.a(task_control.o)
         bthread::TimerThread::run() in libbrpc.a(timer_thread.o)
     "google::LogMessage::stream()", referenced from:
         mcpack2pb::generate_serializing(google::protobuf::Descriptor const*, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, google::protobuf::io::Printer&) in generator.o
         mcpack2pb::is_map_entry(google::protobuf::Descriptor const*) in generator.o
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::ContentionProfiler::init_if_needed() in libbrpc.a(mutex.o)
         butil::FlatMap<bthread::SampledContention*, bthread::SampledContention*, bthread::ContentionHash, bthread::ContentionEqual, false>::init(unsigned long, unsigned int) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStart(char const*) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStop() in libbrpc.a(mutex.o)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] critical27 commented on issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

Posted by GitBox <gi...@apache.org>.
critical27 commented on issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159#issuecomment-851781004


   Still failed on macos big sur 11.3.1, it will fail if `--with-glog`. Will work if no `--with-glog` is added.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] ruoshui1314 commented on issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

Posted by GitBox <gi...@apache.org>.
ruoshui1314 commented on issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159#issuecomment-657433936


   update:
   It could be builded successfully when using master branch.
   The command is:
   `sh config_brpc.sh --headers="/xxx/local/include /usr/local/include" --libs="/xxx/local/lib /usr/local/lib /xxx/local/bin" --cc=clang --cxx=clang++
   `
   and building example is correct.
   
   
   but fail to build 0.9.7 brpc library.
   The detail errors :
   
   `
   Linking protoc-gen-mcpack
   Undefined symbols for architecture x86_64:
     "fLI::FLAGS_v", referenced from:
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::TaskControl::worker_thread(void*) in libbrpc.a(task_control.o)
         bthread::TimerThread::run() in libbrpc.a(timer_thread.o)
     "google::LogMessage::stream()", referenced from:
         mcpack2pb::generate_serializing(google::protobuf::Descriptor const*, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, google::protobuf::io::Printer&) in generator.o
         mcpack2pb::is_map_entry(google::protobuf::Descriptor const*) in generator.o
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::ContentionProfiler::init_if_needed() in libbrpc.a(mutex.o)
         butil::FlatMap<bthread::SampledContention*, bthread::SampledContention*, bthread::ContentionHash, bthread::ContentionEqual, false>::init(unsigned long, unsigned int) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStart(char const*) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStop() in libbrpc.a(mutex.o)
   `


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] ruoshui1314 edited a comment on issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

Posted by GitBox <gi...@apache.org>.
ruoshui1314 edited a comment on issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159#issuecomment-657433936


   update:
   It could be builded successfully when using master branch.
   The command is:
   `
   sh config_brpc.sh --headers="/xxx/local/include /usr/local/include" --libs="/xxx/local/lib /usr/local/lib /xxx/local/bin" --cc=clang --cxx=clang++
   
   `
   and building example is correct.
   
   
   but fail to build 0.9.7 brpc library.
   The detail errors :
   
   
   Linking protoc-gen-mcpack
   Undefined symbols for architecture x86_64:
     "fLI::FLAGS_v", referenced from:
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::TaskControl::worker_thread(void*) in libbrpc.a(task_control.o)
         bthread::TimerThread::run() in libbrpc.a(timer_thread.o)
     "google::LogMessage::stream()", referenced from:
         mcpack2pb::generate_serializing(google::protobuf::Descriptor const*, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, google::protobuf::io::Printer&) in generator.o
         mcpack2pb::is_map_entry(google::protobuf::Descriptor const*) in generator.o
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::ContentionProfiler::init_if_needed() in libbrpc.a(mutex.o)
         butil::FlatMap<bthread::SampledContention*, bthread::SampledContention*, bthread::ContentionHash, bthread::ContentionEqual, false>::init(unsigned long, unsigned int) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStart(char const*) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStop() in libbrpc.a(mutex.o)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] ruoshui1314 edited a comment on issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

Posted by GitBox <gi...@apache.org>.
ruoshui1314 edited a comment on issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159#issuecomment-657433936


   update:
   It could be builded successfully when using master branch.
   The command is:
   `sh config_brpc.sh --headers="/xxx/local/include /usr/local/include" --libs="/xxx/local/lib /usr/local/lib /xxx/local/bin" --cc=clang --cxx=clang++
   `
   and building example is correct.
   
   
   but fail to build 0.9.7 brpc library.
   The detail errors :
   
   
   Linking protoc-gen-mcpack
   Undefined symbols for architecture x86_64:
     "fLI::FLAGS_v", referenced from:
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::TaskControl::worker_thread(void*) in libbrpc.a(task_control.o)
         bthread::TimerThread::run() in libbrpc.a(timer_thread.o)
     "google::LogMessage::stream()", referenced from:
         mcpack2pb::generate_serializing(google::protobuf::Descriptor const*, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, google::protobuf::io::Printer&) in generator.o
         mcpack2pb::is_map_entry(google::protobuf::Descriptor const*) in generator.o
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::ContentionProfiler::init_if_needed() in libbrpc.a(mutex.o)
         butil::FlatMap<bthread::SampledContention*, bthread::SampledContention*, bthread::ContentionHash, bthread::ContentionEqual, false>::init(unsigned long, unsigned int) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStart(char const*) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStop() in libbrpc.a(mutex.o)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] ruoshui1314 edited a comment on issue #1159: fail to build example `echo_c++` and report `Undefined symbols for architecture x86_64:`

Posted by GitBox <gi...@apache.org>.
ruoshui1314 edited a comment on issue #1159:
URL: https://github.com/apache/incubator-brpc/issues/1159#issuecomment-657433936


   update:
   It could be builded successfully when using master branch.
   The command is:
   
   ```shell
   sh config_brpc.sh --headers="/xxx/local/include /usr/local/include" --libs="/xxx/local/lib /usr/local/lib /xxx/local/bin" --cc=clang --cxx=clang++
   
   ```
   and building example is correct.
   
   
   but fail to build 0.9.7 brpc library.
   The detail errors :
   
   
   Linking protoc-gen-mcpack
   Undefined symbols for architecture x86_64:
     "fLI::FLAGS_v", referenced from:
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::TaskControl::worker_thread(void*) in libbrpc.a(task_control.o)
         bthread::TimerThread::run() in libbrpc.a(timer_thread.o)
     "google::LogMessage::stream()", referenced from:
         mcpack2pb::generate_serializing(google::protobuf::Descriptor const*, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, google::protobuf::io::Printer&) in generator.o
         mcpack2pb::is_map_entry(google::protobuf::Descriptor const*) in generator.o
         bthread::ContentionProfiler::flush_to_disk(bool) in libbrpc.a(mutex.o)
         bthread::ContentionProfiler::init_if_needed() in libbrpc.a(mutex.o)
         butil::FlatMap<bthread::SampledContention*, bthread::SampledContention*, bthread::ContentionHash, bthread::ContentionEqual, false>::init(unsigned long, unsigned int) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStart(char const*) in libbrpc.a(mutex.o)
         bthread::ContentionProfilerStop() in libbrpc.a(mutex.o)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org