llvm / llvm/llvm-project

[libcxx] Duplicate symbol with libcpmt.lib for static libc++ builds

Open
#158,562 7 comments 0 reactions 0 assignees View on GitHub
libc++ platform:windows
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I understand parts of libc++ is implemented by linking with the MSVC's standard C++ library implementation. As far as I can tell, however, for static builds this requires linking against `libcpmt`, which causes duplicate symbols when linking executables.

```
lld-link: error: duplicate symbol: int __cdecl std::uncaught_exceptions(void)
>>> defined at D:\a\_work\1\s\src\vctools\crt\github\stl\src\uncaught_exceptions.cpp:9
>>> libcpmt.lib(uncaught_exceptions.obj)
>>> defined at libc++.lib(exception.cpp.obj)
```

Is this a known/expected issue?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.