eworm-de / udp514-journal

forward syslog from network (udp/514) to systemd-journald
GNU General Public License v3.0
10 stars 0 forks source link

Ubuntu 18.04 problem with make #1

Closed DeamonMV closed 5 years ago

DeamonMV commented 5 years ago

Hello.

Tried to compile udp514-journal on ubuntu 18.04 and got a problems

first was this one

gcc -std=c11 -O2 -fPIC -Wall -Werror  -Wl,-z,now -Wl,-z,relro -pie -o udp514-journal udp514-journal.c
In file included from udp514-journal.c:8:0:
udp514-journal.h:23:10: fatal error: systemd/sd-journal.h: No such file or directory
 #include <systemd/sd-journal.h>
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:25: recipe for target 'udp514-journal' failed
make: *** [udp514-journal] Error 1

I installed libsystemd-dev and then got another one:

gcc -std=c11 -O2 -fPIC -Wall -Werror  -Wl,-z,now -Wl,-z,relro -pie -o udp514-journal udp514-journal.c
/tmp/ccUwqKTG.o: In function `main':
udp514-journal.c:(.text.startup+0xa5): undefined reference to `sd_notify'
udp514-journal.c:(.text.startup+0x118): undefined reference to `sd_journal_send_with_location'
udp514-journal.c:(.text.startup+0x12a): undefined reference to `sd_notifyf'
collect2: error: ld returned 1 exit status
Makefile:25: recipe for target 'udp514-journal' failed
make: *** [udp514-journal] Error 1

Can you please describe more about compile and which applications need to install

eworm-de commented 5 years ago

Please install pkg-config.

DeamonMV commented 5 years ago

Thank you for quick reply)

Done

 dpkg -l |grep pkg-config
ii  pkg-config                                 0.29.1-0ubuntu2                              amd64        manage compile and link flags for libraries

but problem still here

just in case

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
eworm-de commented 5 years ago

The CFLAGS for libsystemd should be generated in Makefile by pkg-config, but your gcc call does not contain them. What's the output of this command?

pkg-config --cflags --libs libsystemd
DeamonMV commented 5 years ago
$ pkg-config --cflags --libs libsystemd
-lsystemd
eworm-de commented 5 years ago

That's expected and correct. So no idea what fails... The output (-lsystemd) should appear in gcc call just after -Werror.

DeamonMV commented 5 years ago

i'll try to reboot tomorrow, and let you know if something changed.

DeamonMV commented 5 years ago

reboot. didn't helped. but main question i'm closed - i'm configured rsyslog instead of udp514-journal