# LLVM linker not working?

**URL:** https://discourse.cmake.org/t/llvm-linker-not-working/1532
**Category:** Usage
**Created:** [July 10, 2020, 10:52am UTC](https://discourse.cmake.org/t/llvm-linker-not-working/1532 "2020-07-10T10:52:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![\_0.z](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/_/5daacb/32.png) [@\_0.z](https://discourse.cmake.org/u/_0.z)
#### Post date: [July 10, 2020, 10:52am UTC](https://discourse.cmake.org/t/llvm-linker-not-working/1532/1 "2020-07-10T10:52:52Z")

</div>

- ccmake 3.16.3
- LLVM | CLANG | LLD 10
- Ninja 1.10.0

* * *

My assumption is that [http://lld.llvm.org](http://lld.llvm.org) would be the correct linker to be utilised with LLVM | CLANG and therefore tried

`CMAKE_LINKER = /usr/bin/llvm-link-10`  
`CMAKE_LINKER = /usr/bin/lld-10`  
`CMAKE_LINKER = /usr/bin/ld.lld-10`  
`CMAKE_LINKER = /usr/lib/llvm-10/bin/ld.lld`

However, either seems being neglected and instead invoking _/usr/bin/ld_, producing:

```
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
   The C++ compiler

     "/usr/bin/clang++-10"

   is not able to compile a simple test program.

   It fails with the following output:

     Change Dir: /srv/build/amd64/CMakeFiles/CMakeTmp

     Run Build Command(s):/usr/bin/ninja cmTC_5baff && [1/2] Building CXX object CMakeFiles/cmTC_5baff.dir/testCXXCompiler.cxx.o
     [2/2] Linking CXX executable cmTC_5baff
     FAILED: cmTC_5baff
     : && /usr/bin/clang++-10 CMakeFiles/cmTC_5baff.dir/testCXXCompiler.cxx.o -o cmTC_5baff && :
     /usr/bin/ld: cannot find -lstdc++
     clang: error: linker command failed with exit code 1 (use -v to see invocation)
     ninja: build stopped: subcommand failed.

```

From the documentation I could not find a hint of what might be wrong (what I am missing) and thus would hope for assistance here, unless this a bug of sorts?

---

<div class="post-metadata">

### Author: ![\_0.z](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/_/5daacb/32.png) [@\_0.z](https://discourse.cmake.org/u/_0.z)
#### Post date: [July 10, 2020, 12:20pm UTC](https://discourse.cmake.org/t/llvm-linker-not-working/1532/2 "2020-07-10T12:20:13Z")

</div>

the linker is not invoked by the frontend (_clang+±10_ in this case) and _cmakes_’s `CMAKE_LINKER` does not fit into this context.
