boostorg / boostorg/thread

[boost-1.70.0] Linker error with llvm toolset in VS2017

Open
#286 6 comments 0 reactions 0 assignees View on GitHub
enhancement PR welcome
Dominant language
C++
Stars
214
Forks
171
PR merge metrics
No merged PRs in 30d

Description

My setup: I use static boost-1.70.0 libraries with PlatformToolset v141 (Visual Studio 2017) and
address-model=64 architecture=x86 runtime-link=shared on Windows 7.

When trying to link with PlatformToolset LLVM (clang-cl and lld-link based on clang-8.0), I get a linker error due to undefined symbols because BOOST_THREAD_DECL is resolved to __declspec(dllimport) even though I link statically. The rest of boost is working fine ... if you have doubts about my setup ;-)

The good news is that I already found a workaround: define BOOST_THREAD_USE_LIB globally whenever I use clang-cl.
This solves the issue that clang-cl seems to be not detected correctly in lines 471 to 477 of boost/thread/detail/config.hpp

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.