[Telepathy] Request for "Hello World" program for XMPP-Link-Local

Danielle Madeley danielle.madeley at collabora.co.uk
Tue May 22 16:23:31 PDT 2012


On Tue, 2012-05-22 at 23:31 +0530, Ajay Garg wrote:

> I just need to try it using native C bindings, as C is supposedly the
> fastest system-programming language.

Just to be clear about any misconceptions, this is a D-Bus library that
talks to the network. You're not ever going to be CPU bound, your
program will spend approximately all of its time waiting for IO, writing
in C is going to gain you no appreciable difference, unless perhaps
you're on an embedded device.

> Sorry to bother you, but I am still stuck at the third stage (using C
> binding).

You already know the answer to this problem.

> > I am trying the example given at your link.
> > I have been able to get the "includes" done, however, I don't know
> how to
> > figure out the libraries that need to be linked.
> 
> Try: gcc -o blah `pkg-config --cflags --libs telepathy-glib` blah.c blah2.c
> 
> Note backticks ` not single quotes.

You can also pass -c to the compiler to delay linking. e.g. the way
Makefile.am would do this is:

gcc `pkg-config --cflags telepathy-glib` -c file1.c
gcc `pkg-config --cflags telepathy-glib` -c file2.c
gcc `pkg-config --libs telepathy-glib` -o test file1.o file2.o

-- 
Danielle Madeley
Senior Software Engineer, Collabora Ltd.

www.collabora.co.uk



More information about the telepathy mailing list