-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
vcpkg: Windows static build fails #510
Comments
@rbugajewski @cstratopoulos @LilyWangL Do you know why this happens? I have no idea. Thanks very much. |
@an-tao I’ve also no idea, as I’m primary on macOS or other Unices / Linuxes these days. Maybe it has something to do with the project setup (see https://stackoverflow.com/questions/14890847/how-to-solve-error-lnk2019)? |
But when runing |
My best guess is For reference, part of
|
@interfector18 Thanks so much. I'll try to add CARES_STATICLIB macro when statically building. |
Thank you for taking care of this, I know this is not the most critical thing in the world. |
@interfector18 , You are right, the CARES_STATICLIB macro fixes errors of c-ares library. but there are some other compilation erros of libpq and openssl, they maybe caused by the same reason, I am trying to fix them. |
Glad to help, you should paste them here. |
Thanks so much. here are the errors:
|
It seems to me there is a missing include, as non From greping for dllimport inside openssl, it seems it's not a missing define, but an extra one, specifically OPENSSL_OPT_WINDLL
|
Describe the bug
When building under Windows 10 x64 with Visual Studio 2019 everything works fine when building with dynamic linking as indicated in the instructions:
vcpkg.exe install drogon:x64-windows
When building instead with static linking the process fails because it cannot find c-ares references:
vcpkg.exe install drogon:x64-windows-static
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should compile ;)
Error Messages
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_library_init referenced in function "public: __cdecl trantor::AresResolver::LibraryInitializer::LibraryInitializer(void)" (??0LibraryInitializer@AresResolver@trantor@@qeaa@XZ)
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_library_cleanup referenced in function "public: __cdecl trantor::AresResolver::LibraryInitializer::~LibraryInitializer(void)" (??1LibraryInitializer@AresResolver@trantor@@qeaa@XZ)
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_init_options referenced in function "private: void __cdecl trantor::AresResolver::init(void)" (?init@AresResolver@trantor@@AEAAXXZ)
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_destroy referenced in function "public: virtual __cdecl trantor::AresResolver::~AresResolver(void)" (??1AresResolver@trantor@@UEAA@XZ)
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_set_socket_callback referenced in function "private: void __cdecl trantor::AresResolver::init(void)" (?init@AresResolver@trantor@@AEAAXXZ)
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_gethostbyname referenced in function "private: void __cdecl trantor::AresResolver::resolveInLoop(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::function<void __cdecl(class trantor::InetAddress const &)> const &)" (?resolveInLoop@AresResolver@trantor@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@aebv?$function@$$A6AXAEBVInetAddress@trantor@@@z@4@@z)
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_timeout referenced in function "private: void __cdecl trantor::AresResolver::resolveInLoop(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::function<void __cdecl(class trantor::InetAddress const &)> const &)" (?resolveInLoop@AresResolver@trantor@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@aebv?$function@$$A6AXAEBVInetAddress@trantor@@@z@4@@z)
trantor.lib(AresResolver.cc.obj) : error LNK2019: unresolved external symbol __imp_ares_process_fd referenced in function "private: void __cdecl trantor::AresResolver::onRead(int)" (?onRead@AresResolver@trantor@@AEAAXH@Z)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: