[Spice-devel] spice-gtk-0.24 make error

Christophe Fergeau cfergeau at redhat.com
Tue Apr 8 01:39:22 PDT 2014


On Tue, Apr 08, 2014 at 07:37:02AM +0000, Klaus Hochlehnert wrote:
> Hi,
> 
> I tried to make spice-gtk 0.24 on Ubuntu 12.04 and got this error:
> 
>   CCLD     chezdav
> ./.libs/libphodav.a(libphodav_la-phodav-server.o): In function `parse_propfind':
> /usr/src/spice-gtk-0.24/gtk/phodav/libphodav/phodav-server.c:862: undefined reference to `g_clear_pointer'
> ./.libs/libphodav.a(libphodav_la-phodav-server.o): In function `phodav_server_dispose':
> /usr/src/spice-gtk-0.24/gtk/phodav/libphodav/phodav-server.c:321: undefined reference to `g_clear_pointer'
> /usr/src/spice-gtk-0.24/gtk/phodav/libphodav/phodav-server.c:322: undefined reference to `g_clear_pointer'
> /usr/src/spice-gtk-0.24/gtk/phodav/libphodav/phodav-server.c:323: undefined reference to `g_clear_pointer'
> /usr/src/spice-gtk-0.24/gtk/phodav/libphodav/phodav-server.c:324: undefined reference to `g_clear_pointer'
> collect2: ld returned 1 exit status
> make[6]: *** [chezdav] Error 1
> make[5]: *** [all-recursive] Error 1
> make[4]: *** [all] Error 2
> make[4]: Leaving directory `/usr/src/spice-gtk-0.24/gtk/phodav'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/usr/src/spice-gtk-0.24/gtk'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/usr/src/spice-gtk-0.24/gtk'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/src/spice-gtk-0.24'
> make: *** [all] Error 2
> 
> 
> Any idea what might be missing?

Yup, either phodav is missing a check for glib 2.34 in configure.ac, or it
should be using g_free(foo); foo = NULL; instead of g_clear_pointer(foo);
(or do that through a glib-compat.h file as spice-gtk is doing).

As a workaround, you can add:

#ifndef g_clear_pointer
#define g_clear_pointer(pp, destroy) \
  G_STMT_START {                                                               \
    G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer));                       \
    /* Only one access, please */                                              \
    gpointer *_pp = (gpointer *) (pp);                                         \
    gpointer _p;                                                               \
    /* This assignment is needed to avoid a gcc warning */                     \
    GDestroyNotify _destroy = (GDestroyNotify) (destroy);                      \
                                                                               \
    (void) (0 ? (gpointer) *(pp) : 0);                                         \
    do                                                                         \
      _p = g_atomic_pointer_get (_pp);                                         \
    while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_pp, _p, NULL)); \
                                                                               \
    if (_p)                                                                    \
      _destroy (_p);                                                           \
  } G_STMT_END
#endif

at the beginning of libphodav/phodav-server.c after the various #include.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140408/d08fffed/attachment.sig>


More information about the Spice-devel mailing list