GNOME Bugzilla – Bug 668574
compilation problem with the optional support of systemd
Last modified: 2012-03-23 08:40:25 UTC
Hi, i try to compile gnome-system-monitor-3.3.4 with support of systemd (systemd-38) but I have an error : CREATED org.gnome.gnome-system-monitor.gschema.xml GEN org.gnome.gnome-system-monitor.gschema.valid CXXLD gnome-system-monitor proctable.o: In function `get_process_systemd_info(ProcInfo*)': proctable.cpp:(.text+0x165a): undefined reference to `sd_pid_get_unit(int, char**)' proctable.cpp:(.text+0x1683): undefined reference to `sd_pid_get_session(int, char**)' proctable.cpp:(.text+0x16b2): undefined reference to `sd_session_get_seat(char const*, char**)' proctable.cpp:(.text+0x16c2): undefined reference to `sd_pid_get_owner_uid(int, unsigned int*)' collect2: ld returned 1 exit status make[2]: *** [gnome-system-monitor] Error 1 make[2]: Leaving directory `/var/tmp/fst/src/gnome-system-monitor-3.3.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/fst/src/gnome-system-monitor-3.3.4' make: *** [all] Error 2 Thanks
Which OS are you running? Do you have systemd?
OS : Frugalware x86_64 Systemd : Systemd-38 root@Fw_Build:/# pkg-config --modversion systemd 38 root@Fw_Build:/# ls -la /usr/include/systemd/ total 45 drwxr-xr-x 2 root root 208 15 janv. 20:21 . drwxr-xr-x 108 root root 8672 25 janv. 14:22 .. -rw-r--r-- 1 root root 10851 15 janv. 20:21 sd-daemon.h -rw-r--r-- 1 root root 2206 15 janv. 20:21 sd-id128.h -rw-r--r-- 1 root root 4322 15 janv. 20:21 sd-journal.h -rw-r--r-- 1 root root 4761 15 janv. 20:21 sd-login.h -rw-r--r-- 1 root root 1145 15 janv. 20:21 sd-messages.h
From what I can tell from looking though the systemd git repo, the minimum requirement should be systemd 38. The sd_pid_get_unit function was added in that cycle. It seems you're on that version so I'm not sure what's happening on your system. I'm about to install Fedora Rawhide in a virtual machine so I can test this. I'm also CCing Lennart as he'll probably know what's up.
sd_pid_get_session() is available since the first version of the library, so this doesn't appear to be a versioning problem, but rather some issue where the CFLAGS and LIBS are not properly built. Please provide the same output with "make V=1"
the output with make V=1 make V=1 make all-recursive make[1] : on entre dans le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4 » Making all in pixmaps make[2] : on entre dans le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4/pixmaps » make[2]: Rien à faire pour « all ». make[2] : on quitte le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4/pixmaps » Making all in po make[2] : on entre dans le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4/po » make[2]: Rien à faire pour « all ». make[2] : on quitte le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4/po » Making all in src make[2] : on entre dans le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4/src » /bin/sh ../libtool --tag=CXX --mode=link g++ -Wall -std=c++98 -march=x86-64 -mtune=generic -O2 -pipe -Wl,--hash-style=both -o gnome-system-monitor argv.o procman.o interface.o callbacks.o load-graph.o proctable.o prettytable.o util.o procactions.o procdialogs.o memmaps.o openfiles.o procproperties.o smooth_refresh.o disks.o selinux.o cgroups.o procman_gnomesu.o procman_gksu.o sysinfo.o lsof.o selection.o settings-keys.o iconthemewrapper.o e_date.o gsm_color_button.o -pthread -Wl,--export-dynamic -lgtop-2.0 -lwnck-3 -lstartup-notification-1 -lXRes -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lpangomm-1.4 -lgtk-3 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lpangoft2-1.0 -lpangocairo-1.0 -lcairo-gobject -lpango-1.0 -lrsvg-2 -lgdk_pixbuf-2.0 -lcairo -lpixman-1 -lfontconfig -lxml2 -lfreetype -lbz2 -lEGL -lGL -lpng14 -lm -lxcb-shm -lxcb-render -lXrender -ldrm -lXdamage -lXxf86vm -lX11-xcb -lxcb-glx -lXfixes -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp -lgiomm-2.4 -lgio-2.0 -lz -lresolv -lglibmm-2.4 -lgobject-2.0 -lffi -lsigc-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lrt -lsystemd-daemon -lsystemd-login libbacon.la libtool: link: g++ -Wall -std=c++98 -march=x86-64 -mtune=generic -O2 -pipe -Wl,--hash-style=both -o gnome-system-monitor argv.o procman.o interface.o callbacks.o load-graph.o proctable.o prettytable.o util.o procactions.o procdialogs.o memmaps.o openfiles.o procproperties.o smooth_refresh.o disks.o selinux.o cgroups.o procman_gnomesu.o procman_gksu.o sysinfo.o lsof.o selection.o settings-keys.o iconthemewrapper.o e_date.o gsm_color_button.o -pthread -Wl,--export-dynamic /usr/lib/libgtop-2.0.so /usr/lib/libwnck-3.so -L/usr/lib /usr/lib/libstartup-notification-1.so /usr/lib/libxcb-util.so /usr/lib/libXRes.so /usr/lib/libgtkmm-3.0.so /usr/lib/libatkmm-1.6.so /usr/lib/libgdkmm-3.0.so /usr/lib/libpangomm-1.4.so /usr/lib/libgtk-3.so /usr/lib/libcairomm-1.0.so /usr/lib/libgdk-3.so /usr/lib/libatk-1.0.so /usr/lib/libXinerama.so /usr/lib/libXrandr.so /usr/lib/libXcursor.so /usr/lib/libXcomposite.so /usr/lib/libcairo-gobject.so /usr/lib/librsvg-2.so /usr/lib/libpangocairo-1.0.so /usr/lib/libpangoft2-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libcroco-0.6.so /usr/lib/libgdk_pixbuf-2.0.so /usr/lib/libcairo.so /usr/lib/libpixman-1.so /usr/lib/libfontconfig.so /usr/lib/libxml2.so /usr/lib/libfreetype.so -lbz2 -lEGL /usr/lib/libGL.so /usr/lib/libXmu.so /usr/lib/libXt.so /usr/lib/libSM.so /usr/lib/libuuid.so /usr/lib/libICE.so /usr/lib/libXi.so /usr/lib/libpng14.so /usr/lib/libxcb-shm.so /usr/lib/libxcb-render.so /usr/lib/libXrender.so /usr/lib/libdrm.so /usr/lib/libXdamage.so /usr/lib/libXxf86vm.so /usr/lib/libX11-xcb.so /usr/lib/libxcb-glx.so /usr/lib/libXfixes.so /usr/lib/libXext.so /usr/lib/libX11.so /usr/lib/libxcb.so /usr/lib/libXau.so /usr/lib/libXdmcp.so /usr/lib/libgiomm-2.4.so /usr/lib/libgio-2.0.so -lz -lresolv /usr/lib/libglibmm-2.4.so /usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so /usr/lib/libffi.so /usr/lib/libsigc-2.0.so /usr/lib/../lib/libstdc++.so -lm /usr/lib/libgmodule-2.0.so /usr/lib/libglib-2.0.so -lpthread /usr/lib/libsystemd-daemon.so /usr/lib/libsystemd-login.so -lcap -ldl -lrt ./.libs/libbacon.a -pthread -Wl,-rpath -Wl,/usr/lib/../lib -Wl,-rpath -Wl,/usr/lib/../lib proctable.o: In function `get_process_systemd_info(ProcInfo*)': proctable.cpp:(.text+0x165a): undefined reference to `sd_pid_get_unit(int, char**)' proctable.cpp:(.text+0x1683): undefined reference to `sd_pid_get_session(int, char**)' proctable.cpp:(.text+0x16b2): undefined reference to `sd_session_get_seat(char const*, char**)' proctable.cpp:(.text+0x16c2): undefined reference to `sd_pid_get_owner_uid(int, unsigned int*)' collect2: ld returned 1 exit status make[2]: *** [gnome-system-monitor] Erreur 1 make[2] : on quitte le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4/src » make[1]: *** [all-recursive] Erreur 1 make[1] : on quitte le répertoire « /var/tmp/fst/src/gnome-system-monitor-3.3.4 » make: *** [all] Erreur 2
getting this on 3.3.90 when trying to enable systemd-support (systemd v43) In file included from proctable.cpp:49:0: /usr/include/systemd/sd-login.h:97:54: error: expected ‘,’ or ‘...’ before ‘class’ make[2]: *** [gnome_system_monitor-proctable.o] Error 1
Same problem with 3.3.91 and systemd v43
Don't know why (most likely an upgrade of another system component like dbus) but this problem is now gone for me. (with systemd v44)
Thanks Andreas. I was also able to finally try this myself 2 days ago. I didn't run into any problems. How about you Baste? Any luck?
Always the same problem with gnome-system-monitor-3.3.92 ans systemd 43 CXX gnome_system_monitor-procactions.o In file included from proctable.cpp:49:0: /usr/include/systemd/sd-login.h:97:54: error: expected ',' or '...' before 'class' CXX gnome_system_monitor-procdialogs.o CXX gnome_system_monitor-memmaps.o make[2]: *** [gnome_system_monitor-proctable.o] Error 1 make[2]: *** Waiting for unfinished jobs....
Initially your problem was at link time but what your showing here is a compile time issue. Maybe try again with systemd 44. Sounds like a borked system to me, though.
Yes, forgot to mention this here, in v44 we fixed C++ compat of the header files. (We had a parameter for a function called "class" which is OK in pure C but isn't in C embedded in C++. We now have renamed that param in v44 hence the problem should be gone. Please upgrade. Note that the only release of systemd with "class" as param name was 43.)
Created attachment 210320 [details] [review] Patch to disallow building with systemd v43
I've requested a freeze exception for the above patch.
I got the freeze exception for this and pushed. Thanks everyone.