Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error linking with folly when building Proxygen on Mac OS #537

Open
VinothParamaguru opened this issue Nov 16, 2024 · 6 comments
Open

Error linking with folly when building Proxygen on Mac OS #537

VinothParamaguru opened this issue Nov 16, 2024 · 6 comments

Comments

@VinothParamaguru
Copy link

VinothParamaguru commented Nov 16, 2024

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.

@SteveSelva
Copy link
Contributor

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

@VinothParamaguru
Copy link
Author

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.

@SteveSelva
Copy link
Contributor

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.

@VinothParamaguru
Copy link
Author

VinothParamaguru commented Nov 25, 2024

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

@afrind
Copy link
Contributor

afrind commented Nov 26, 2024

I saw this comment which is somewhat related?

facebook/folly#1655 (comment)

Something about c++abi lib dependency on mac?

@SteveSelva
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants