Results 1 to 6 of 6

Thread: C and Libnotify

  1. #1
    Join Date
    Dec 2005
    Beans
    69
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    C and Libnotify

    I'm trying to add libnotify support to a program, but I keep running into a problem with the compiling step. The only resource I've found so far is this:

    http://manishtech.wordpress.com/2009...ith-libnotify/

    Are there any better resources with, say, a list of dependencies and what I'd need to call in GCC to get the example code there to compile? I'd really like to figure this out, but I'm completely lost and without resources. Right now I'm compiling with:

    gcc `pkg-config --cflags --libs gtk+-2.0` temp.c -llibnotify -o notify

    But I get a comment that ld can not find libnotify. Any help would be great.

  2. #2
    Join Date
    Nov 2006
    Beans
    1,134

    Re: C and Libnotify

    Quote Originally Posted by winter_mute View Post
    But I get a comment that ld can not find libnotify.
    Your command line is wrong. It should be -lnotify, not -llibnotify
    Last edited by eye208; May 5th, 2009 at 07:52 PM.

  3. #3
    Join Date
    Dec 2005
    Beans
    69
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: C and Libnotify

    Aha! Thanks! I was entirely at a loss. That fixed it perfectly.

  4. #4
    Join Date
    Jul 2007
    Location
    Hillsboro, OR
    Beans
    317
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: C and Libnotify

    I am honoured that my blog post was beneficial for the public. I would research more on this library and write more blog posts. Well in the post itself I have written

    $ gcc `pkg-config –cflags –libs gtk+-2.0` notify.c -o notify -l notify
    Sorry for bumping an old thread.
    Zeitgeist and Ubuntu Privacy Manager Developer


  5. #5
    Join Date
    Apr 2006
    Beans
    370

    Re: C and Libnotify

    That's not really ideal either; just add libnotify to the pkg-config command line so that pkg-config can handle everything for you:

    Code:
    gcc `pkg-config --cflags --libs gtk+-2.0 libnotify` notify.c -o notify

  6. #6
    Join Date
    Jul 2007
    Location
    Hillsboro, OR
    Beans
    317
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: C and Libnotify

    Hey crdlb

    Thanks for the info
    Zeitgeist and Ubuntu Privacy Manager Developer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •