# \-Wl,-force\_link flags not working correctly

**URL:** https://discourse.cmake.org/t/wl-force-link-flags-not-working-correctly/322
**Category:** Code
**Created:** [December 5, 2019, 1:03am UTC](https://discourse.cmake.org/t/wl-force-link-flags-not-working-correctly/322 "2019-12-05T01:03:49Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![oliverdain](https://discourse.cmake.org/user_avatar/discourse.cmake.org/oliverdain/32/220_2.png) [@oliverdain](https://discourse.cmake.org/u/oliverdain)
#### Post date: [December 5, 2019, 6:38pm UTC](https://discourse.cmake.org/t/wl-force-link-flags-not-working-correctly/322/7 "2019-12-05T18:38:21Z")

</div>

Ug. I spoke too soon.

There’s actually several libraries I’m trying to `-force_load`. As you can see, `avfilter` for example, depends on `avresample`, `swscale`, etc. and this is defined in the `set_target_properties`. If I link them like I was doing before cmake ensures that things are linked in the correct order. However, when I put them in quotes with the generator expression cmake no longer knows that these refer to the libraries I’d defined earlier so it doesn’t not ensure correct link order and I get undefined symbols at link time. I’ll try the `target_link_options` path instead and see if that does it.

---

_[View the full topic](https://discourse.cmake.org/t/wl-force-link-flags-not-working-correctly/322)._
