Beginning to write a client
Greg Chagnon
gcgaim at gmail.com
Fri May 18 16:12:40 EDT 2007
Thanks....I'm getting there. Now it's:
# gcc `pkg-config --libs glib-2.0` -I /usr/include/libpurple/ -I
/usr/include/glib-2.0/ -I /usr/lib/glib-2.0/include/ nullclient.c
/tmp/ccBPvTts.o: In function `null_write_conv':
nullclient.c:(.text+0x16e): undefined reference to `purple_utf8_strftime'
nullclient.c:(.text+0x17b): undefined reference to
`purple_conversation_get_name'
/tmp/ccBPvTts.o: In function `null_ui_init':
nullclient.c:(.text+0x1b7): undefined reference to
`purple_conversations_set_ui_ops'
/tmp/ccBPvTts.o: In function `init_libpurple':
nullclient.c:(.text+0x1cb): undefined reference to
`purple_util_set_user_dir'
nullclient.c:(.text+0x1d7): undefined reference to
`purple_debug_set_enabled'
nullclient.c:(.text+0x1e3): undefined reference to `purple_core_set_ui_ops'
nullclient.c:(.text+0x1ef): undefined reference to
`purple_eventloop_set_ui_ops'
nullclient.c:(.text+0x1fb): undefined reference to
`purple_plugins_add_search_path'
nullclient.c:(.text+0x207): undefined reference to `purple_core_init'
nullclient.c:(.text+0x23a): undefined reference to `purple_blist_new'
nullclient.c:(.text+0x242): undefined reference to `purple_set_blist'
nullclient.c:(.text+0x247): undefined reference to `purple_blist_load'
nullclient.c:(.text+0x24c): undefined reference to `purple_prefs_load'
nullclient.c:(.text+0x258): undefined reference to
`purple_plugins_load_saved'
nullclient.c:(.text+0x25d): undefined reference to `purple_pounces_load'
/tmp/ccBPvTts.o: In function `signed_on':
nullclient.c:(.text+0x270): undefined reference to
`purple_connection_get_account'
/tmp/ccBPvTts.o: In function
`connect_to_signals_for_demonstration_purposes_only':
nullclient.c:(.text+0x2a5): undefined reference to
`purple_connections_get_handle'
nullclient.c:(.text+0x2c9): undefined reference to `purple_signal_connect'
/tmp/ccBPvTts.o: In function `main':
nullclient.c:(.text+0x318): undefined reference to
`purple_plugins_get_protocols'
nullclient.c:(.text+0x465): undefined reference to `purple_account_new'
nullclient.c:(.text+0x489): undefined reference to
`purple_account_set_password'
nullclient.c:(.text+0x4a4): undefined reference to
`purple_account_set_enabled'
nullclient.c:(.text+0x4b8): undefined reference to `purple_savedstatus_new'
nullclient.c:(.text+0x4c6): undefined reference to
`purple_savedstatus_activate'
collect2: ld returned 1 exit status
On 5/18/07, Mark Doliner <mark at kingant.net> wrote:
>
> Looks like you need to link against glib (not just include the
> headers). Try
> adding `pkg-config --libs glib-2.0` to your compile line.
>
> -Mark
>
> On Fri, 18 May 2007 12:08:56 -0400, Greg Chagnon wrote
> > Sure can...
> >
> > # gcc -I /usr/include/libpurple/ -I /usr/include/glib-2.0/ -I
> /usr/lib/glib-
> > 2.0/include/ nullclient.c
> > /tmp/ccWmk8Ch.o: In function `purple_glib_io_destroy':
> > nullclient.c:(.text+0xd): undefined reference to `g_free'
> > /tmp/ccWmk8Ch.o: In function `purple_glib_io_invoke':
> > nullclient.c:(.text+0x4f): undefined reference to
> `g_io_channel_unix_get_fd'
> > /tmp/ccWmk8Ch.o: In function `glib_input_add':
> > nullclient.c:(.text+0x84): undefined reference to `g_malloc0'
> > nullclient.c:(.text+0xc6): undefined reference to
> `g_io_channel_unix_new'
> > nullclient.c:(.text+0xfa): undefined reference to `g_io_add_watch_full'
> > nullclient.c:(.text+0x10d): undefined reference to `g_io_channel_unref'
> > /tmp/ccWmk8Ch.o: In function `null_write_conv':
> > nullclient.c:(.text+0x16e): undefined reference to
> `purple_utf8_strftime'
> > nullclient.c:(.text+0x17b): undefined reference to
> > `purple_conversation_get_name'
> > /tmp/ccWmk8Ch.o: In function `null_ui_init':
> > nullclient.c:(.text+0x1b7): undefined reference to
> > `purple_conversations_set_ui_ops'
> > /tmp/ccWmk8Ch.o: In function `init_libpurple':
> > nullclient.c:(.text+0x1cb): undefined reference to
> > `purple_util_set_user_dir'
> > nullclient.c:(.text+0x1d7): undefined reference to
> > `purple_debug_set_enabled'
> > nullclient.c:(.text+0x1e3): undefined reference to
> `purple_core_set_ui_ops'
> > nullclient.c:(.text+0x1ef): undefined reference to
> > `purple_eventloop_set_ui_ops'
> > nullclient.c:(.text+0x1fb): undefined reference to
> > `purple_plugins_add_search_path'
> > nullclient.c:(.text+0x207): undefined reference to `purple_core_init'
> > nullclient.c:(.text+0x23a): undefined reference to `purple_blist_new'
> > nullclient.c:(.text+0x242): undefined reference to `purple_set_blist'
> > nullclient.c:(.text+0x247): undefined reference to
> > `purple_blist_load' nullclient.c:(.text+0x24c): undefined reference
> > to `purple_prefs_load' nullclient.c:(.text+0x258): undefined
> > reference to `purple_plugins_load_saved' nullclient.c:(.text+0x25d):
> > undefined reference to `purple_pounces_load' /tmp/ccWmk8Ch.o: In
> > function `signed_on': nullclient.c:(.text+0x270): undefined
> > reference to `purple_connection_get_account' /tmp/ccWmk8Ch.o: In
> function
> > `connect_to_signals_for_demonstration_purposes_only':
> > nullclient.c:(.text+0x2a5): undefined reference to
> > `purple_connections_get_handle'
> > nullclient.c:(.text+0x2c9): undefined reference to
> `purple_signal_connect'
> > /tmp/ccWmk8Ch.o: In function `main':
> > nullclient.c:(.text+0x2ff): undefined reference to `g_main_loop_new'
> > nullclient.c:(.text+0x318): undefined reference to
> > `purple_plugins_get_protocols'
> > nullclient.c:(.text+0x37b): undefined reference to `g_list_append'
> > nullclient.c:(.text+0x3f1): undefined reference to `g_list_nth_data'
> > nullclient.c:(.text+0x465): undefined reference to `purple_account_new'
> > nullclient.c:(.text+0x489): undefined reference to
> > `purple_account_set_password'
> > nullclient.c:(.text+0x4a4): undefined reference to
> > `purple_account_set_enabled'
> > nullclient.c:(.text+0x4b8): undefined reference to
> `purple_savedstatus_new'
> > nullclient.c:(.text+0x4c6): undefined reference to
> > `purple_savedstatus_activate'
> > nullclient.c:(.text+0x4d6): undefined reference to `g_main_loop_run'
> > /tmp/ccWmk8Ch.o:(.data+0x0): undefined reference to `g_timeout_add'
> > /tmp/ccWmk8Ch.o:(.data+0x4): undefined reference to `g_source_remove'
> > /tmp/ccWmk8Ch.o:(.data+0xc): undefined reference to `g_source_remove'
> > collect2: ld returned 1 exit status
> >
> > On 5/18/07, Mark Doliner <mark at kingant.net> wrote:
> > >
> > > Quite possibly. Are you getting an error message or something? If
> so,
> > > could
> > > we see it?
> > >
> > > -Mark
> > >
> > > On Fri, 18 May 2007 09:02:39 -0400, Greg Chagnon wrote
> > > > OK, so I have nullclient.c and defines.h, but when I compile I seem
> > > > to be missing some libs. I have libpuple, libpurple-devel, libtk,
> > > > libtcl, and glib-devel installed. Anything else that I'm missing?
> > > >
> > > > On 5/17/07, Sadrul Habib Chowdhury <imadil at gmail.com> wrote:
> > > > >
> > > > > * Greg Chagnon had this to say on [17 May 2007, 16:28:18 -0400]:
> > > > > > Hi All,
> > > > > > I'm new to this list and libpurple but wanted to ask a rather
> open
> > > ended
> > > > > > question. I'd like to write a very basic command line IM
> > > client. The
> > > > > only
> > > > > > functionality it would have to have is to connect to a server,
> send
> > > an
> > > > > IM,
> > > > > > and be able to receive an IM and verify its message against what
> was
> > > > > sent.
> > > > > > At a later date I'd add in conferencing and file transfer. So
> I'm
> > > > > asking
> > > > > > for anything that could get me started on writing a client in
> > > C++. I
> > > > > tend
> > > > > > to work best by seeing examples.
> > > > > >
> > > > >
> > > > > There is a nullclient in libpurple/example/ that allows you to
> create
> > > > > and connect to one IM service of your choice and receive messages.
> It
> > > > > was meant to be a really simple client, and adding the ability to
> send
> > > > > messages would've made it rather complicated for a 'Hello world'
> > > client.
> > > > > (
> > > > >
> > >
> > >
>
> http://developer.pidgin.im/viewmtn/revision/file/e39b5117f8df79ccfe2f383c3b0bbe8f33566991/libpurple/example/nullclient.c
> > > > > )
> > > > >
> > > > > There are some development FAQs for client/plugin authors in
> > > > > http://d.pidgin.im/wiki/Development%20FAQ, which you may find
> useful.
> > > > > You should also look at http://d.pidgin.im/wiki/WhatIsLibpurple.
> We
> > > will
> > > > > be glad to answer any farther questions you may have.
> > > > >
> > > > > Sadrul
> > > > >
> > > > > > The reasons I'm doing this is, first, to test a part of a
> network
> > > > > appliance
> > > > > > in an automated fashion. And second, I'm seeing a lot of "How
> do I
> > > get
> > > > > > started" messages being posted. So I'd also like to document my
> > > > > experience
> > > > > > and the steps that I take to write this client so that others
> can
> > > > > benefit
> > > > > > from it.
> > > > > >
> > > > > > Any and all information that you all could point me to would be
> > > *very*
> > > > > > helpful!
> > > > > >
> > > > > > Thanks,
> > > > > > g
> > >
> > >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20070518/9dadaa2d/attachment.html>
More information about the Devel
mailing list