proxygen icon indicating copy to clipboard operation
proxygen copied to clipboard

Error linking with folly when building Proxygen on Mac OS

Open VinothParamaguru opened this issue 1 year ago • 6 comments

Hi

Could someone please help me with the errors below. I'm trying build the EchoServer that comes as part of proxygen. I have not installed proxygen from the source, but have used vcpkg to link the dependencies.

"EchoService::EchoHandler::EchoHandler(EchoService::EchoStats*)", referenced from: EchoHandlerFactory::onRequest(proxygen::RequestHandler*, proxygen::HTTPMessage*) in EchoServer.cpp.o "proxygen::HTTPServer::bind(std::__1::vector<proxygen::HTTPServer::IPConfig, std::__1::allocatorproxygen::HTTPServer::IPConfig> const&)", referenced from: _main in EchoServer.cpp.o "proxygen::HTTPServer::start(std::__1::function<void ()>, std::__1::function<void (std::exception_ptr)>, std::__1::function<std::__1::shared_ptrwangle::AcceptorFactory (proxygen::HTTPServer::AcceptorFactoryConfig)>, std::__1::shared_ptrfolly::IOThreadPoolExecutorBase)", referenced from: main::$_0::operator()() const in EchoServer.cpp.o "proxygen::HTTPServer::HTTPServer(proxygen::HTTPServerOptions)", referenced from: _main in EchoServer.cpp.o "proxygen::HTTPServer::~HTTPServer()", referenced from: _main in EchoServer.cpp.o "__cxa_decrement_exception_refcount", referenced from: folly::detail::exception_cleanup(Unwind_Reason_Code, Unwind_Exception*) in libfolly.a(Exception.cpp.o) "cxa_increment_exception_refcount", referenced from: folly::detail::exception_ptr_get_type(std::exception_ptr const&) in libfolly.a(Exception.cpp.o) folly::detail::exception_ptr_get_object(std::exception_ptr const&, std::type_info const*) in libfolly.a(Exception.cpp.o) folly::detail::make_exception_ptr_with(folly::detail::make_exception_ptr_with_arg const&, void*) in libfolly.a(Exception.cpp.o) decltype(auto) folly::detail::cxxabi_with_cxa_exception<folly::detail::exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*)::$1>(void*, folly::detail::exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*)::$_1) in libfolly.a(Exception.cpp.o) ld: symbol(s) not found for architecture x86_64

I'm using Mac OS 13.7.1 (22H221)

Thanks.

VinothParamaguru avatar Nov 16 '24 21:11 VinothParamaguru

Ensure that the dependencies you installed are properly installed according to your architecture. (x86_64 for Intel-based Macs or arm64 for Apple Silicon).

To check whether the dependency is installed use this command: lipo -info libfolly.a

SteveSelva avatar Nov 19 '24 06:11 SteveSelva

Thanks @SteveSelva . I've tried lipo -info libfolly.a It shows - "Non-fat file: libfolly.a is architecture: x86_64" But, still the same issue persists.

Are there any samples are you aware available to consume proxygen library under a vcpkg setup ?

Thanks.

VinothParamaguru avatar Nov 19 '24 23:11 VinothParamaguru

Can you provide the complete logs of the build process. Since you have folly, there may be any other missing dependency. As I am using proxygen in windows, and its working fine with vcpkg for me. I don't know about MacOS.

SteveSelva avatar Nov 20 '24 12:11 SteveSelva

Hi @SteveSelva .

I've attached the cmake output and make output for reference. Also have attached CMakeLists.txt.

Thanks.

cmake_output.txt make_output.txt CMakeLists.txt

VinothParamaguru avatar Nov 25 '24 22:11 VinothParamaguru

I saw this comment which is somewhat related?

https://github.com/facebook/folly/issues/1655#issuecomment-919448706

Something about c++abi lib dependency on mac?

afrind avatar Nov 26 '24 22:11 afrind

From the make_output logs, Undefined symbols for architecture x86_64: "proxygen::HTTPServer::bind(std::__1::vector<proxygen::HTTPServer::IPConfig, std::__1::allocatorproxygen::HTTPServer::IPConfig> const&)", referenced from: _main in EchoServer.cpp.o "proxygen::HTTPServer::start(std::__1::function<void ()>, std::__1::function<void (std::exception_ptr)>, std::__1::function<std::__1::shared_ptrwangle::AcceptorFactory (proxygen::HTTPServer::AcceptorFactoryConfig)>, std::__1::shared_ptrfolly::IOThreadPoolExecutorBase)", referenced from: main::$_0::operator()() const in EchoServer.cpp.o "proxygen::HTTPServer::HTTPServer(proxygen::HTTPServerOptions)", referenced from: _main in EchoServer.cpp.o "proxygen::HTTPServer::~HTTPServer()", referenced from: _main in EchoServer.cpp.o

The proxygenhttpserver.lib is missing and not linked while building the EchoServer. Build proxygenhttpserver and link that library to EchoServer.

SteveSelva avatar Nov 27 '24 06:11 SteveSelva