# Linker problem using systemd library at C application for yocto

**URL:** <https://forums.digi.com/t/linker-problem-using-systemd-library-at-c-application-for-yocto/21592>\
**Category:** Linux\
**Tags:** ccimx6ulsbc, systemd, ccimx6ul\
**Created:** [July 27, 2020, 8:24am UTC](https://forums.digi.com/t/linker-problem-using-systemd-library-at-c-application-for-yocto/21592 "2020-07-27T08:24:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TCRobotics](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@TCRobotics](https://forums.digi.com/u/TCRobotics)\
**Post date:** [July 27, 2020, 8:24am UTC](https://forums.digi.com/t/linker-problem-using-systemd-library-at-c-application-for-yocto/21592/1 "2020-07-27T08:24:57Z")

</div>

I make a yocto image for ConectCore 6UL with systemd (working and tested ok)

Also installed libsystemd-dev at my developing computer.

Added -lsystemd to the compiler and linker flags at Digi eclipse application.

At my project I have:

#include  
#include  
#include  
#include  
…  
sd\_notify(0, “WATCHDOG=1”);  
…

But the linker complains:  
real-ld: cannot find -lsystemd

also tried with -llibsystemd with the same luck ☹

Any help welcomed!

---

<div class="post-metadata">

**Author:** ![TCRobotics](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@TCRobotics](https://forums.digi.com/u/TCRobotics)\
**Post date:** [July 28, 2020, 9:21am UTC](https://forums.digi.com/t/linker-problem-using-systemd-library-at-c-application-for-yocto/21592/2 "2020-07-28T09:21:55Z")

</div>

SOLVED!! 🙂

Copied the header systemd folder of installed libsystemd-dev library (/usr/include/systemd) to my project:

project/  
└src/  
. ├systemd/  
. └main.c

As I need the arch compiled library I take directly the systemd library of my generated yocto image (/lib/libsystemd.so.0.23.0) and put it at systemd folder:

project/  
└src/  
. ├systemd/  
. │ └libsystemd.so.0.23.0  
. └main.c

At project properties went to the C/C++ Build -\> Settings -\> GCC C Linker -\> Miscellaneous. In the Other objects added the path to libsystemd.so.0.23.0 “${workspace\_loc:/${ProjName}/src/systemd/libsystemd.so.0.23.0}”

And it compiles and links without errors 🙂

Hope this helps someone!
