# Link libraries with armcc/armlink

**URL:** https://discourse.cmake.org/t/link-libraries-with-armcc-armlink/1928
**Category:** Code
**Created:** [September 28, 2020, 2:12pm UTC](https://discourse.cmake.org/t/link-libraries-with-armcc-armlink/1928 "2020-09-28T14:12:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SadE](https://discourse.cmake.org/user_avatar/discourse.cmake.org/sade/32/848_2.png) [@SadE](https://discourse.cmake.org/u/SadE)
#### Post date: [September 28, 2020, 2:12pm UTC](https://discourse.cmake.org/t/link-libraries-with-armcc-armlink/1928/1 "2020-09-28T14:12:06Z")

</div>

Hi  
I’m trying to have a setup for the armcc compiler from Keil/ARM . The compiler is supported well but I get some problem linking libraries.  
The correct way of using the linker with test.c and sample.lib is  
`armlink.exe test.o sample.lib ...`  
But if I’m using target\_link\_libraries here what I get in Ninja command:  
`armlink.exe test.o -l sample.lib`  
and armlink report an error , the -l flag is not recognized.  
How can I link correctly my libs ?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 22, 2020, 7:49pm UTC](https://discourse.cmake.org/t/link-libraries-with-armcc-armlink/1928/2 "2020-11-22T19:49:11Z")

</div>

I’m not sure of our status on Keil/ARM support. I remember there being old discussion about it, but I don’t see anything in the repository right now.

Cc: @brad.king

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [November 23, 2020, 1:12pm UTC](https://discourse.cmake.org/t/link-libraries-with-armcc-armlink/1928/3 "2020-11-23T13:12:11Z")

</div>

See [CMake Issue 19357](https://gitlab.kitware.com/cmake/cmake/-/issues/19357) for discussion of Keil/ARM support.
