PDA

View Full Version : C and Libnotify



winter_mute
May 5th, 2009, 06:21 PM
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/03/29/working-with-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.

eye208
May 5th, 2009, 07:48 PM
But I get a comment that ld can not find libnotify.
Your command line is wrong. It should be -lnotify, not -llibnotify

winter_mute
May 6th, 2009, 12:26 AM
Aha! Thanks! I was entirely at a loss. That fixed it perfectly.

manishtech
May 16th, 2009, 10:43 PM
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.

crdlb
May 18th, 2009, 08:45 PM
That's not really ideal either; just add libnotify to the pkg-config command line so that pkg-config can handle everything for you:


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

manishtech
May 18th, 2009, 09:44 PM
Hey crdlb (http://ubuntuforums.org/member.php?u=90928)

Thanks for the info