compile glib-gdbus

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LubinLew
    New Member
    • Jun 2014
    • 1

    compile glib-gdbus

    I'm trying to compile a C program on CentOS.
    it doesn't work and gives me this error:
    Code:
    /tmp/ccJUzelS.o: In function `main':
    bus_own_name.c:69: undefined reference to `g_bus_own_name'
    bus_own_name.c:81: undefined reference to `g_bus_unown_name'
    collect2: ld returned 1 exit status
    code:
    https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-own-name.c
    compile command:
    Code:
    gcc -g `pkg-config --cflags dbus-glib-1 dbus-1 glib-2.0 gthread-2.0` bus_own_name.c `pkg-config --libs dbus-glib-1 dbus-1 glib-2.0 gthread-2.0`
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    The error is stating it can't find g_bus_own_name( ) - and you don't declare this function, so is it in the gio.h library?

    Comment

    • Jennypliskin
      New Member
      • Sep 2013
      • 30

      #3
      You need to install some packages. I think everything you need is included in the group of packages installed by the following command (as root):

      yum groupinstall 'Development Tools'

      I don't currently have admin rights on any Centos system, so I can't check whether I got the syntax of that command right or whether there are any header or library files you will also need that might not be included in that group.

      If you google the command I suggested, you will see lots of pages that explain what it includes. Those pages probably will give you other info you will need.

      Comment

      Working...