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!
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!
1 Like