drogonframework / drogonframework/drogon

vcpkg: Windows static build fails

Open
#510 11 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 12h
Merged PRs (30d)
15

Description

**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:
1. Start Windows 10 x64
2. Install Visual Studio 2019
3. Install vcpkg (https://github.com/Microsoft/vcpkg)
4. Run "vcpkg.exe install drogon:x64-windows-static"

**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,class std::allocator > const &,class std::function 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,class std::allocator > const &,class std::function 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.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `vcpkg.exe install drogon:x64-windows-static` on Windows 10 x64 and Visual Studio 2019. Start with `trantor.lib(AresResolver.cc.obj)` and the unresolved c-ares symbols, then inspect how the static build links c-ares. Done means the static installation completes without the listed linker errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.