Bug#471195: libglibmm-2.4-dev: Problem compiling programs with glibmm: undefined reference to 'g_thread_init'

Deng Xiyue manphiz-guest at users.alioth.debian.org
Sun Mar 16 15:58:40 UTC 2008


severity 471195 wishlist
retitle 471195 Add gthread-2.0 to glibmm2.4 pkg-config support by default
thanks

Andre Offringa <offringa at gmail.com> writes:

> Package: libglibmm-2.4-dev
> Version: 2.14.2-4
> Severity: normal
>
> When compiling programs that use glibmm using the libraries specified by pkg-config:
> /usr/include/glibmm-2.4/glibmm/thread.h:784: undefined reference to `g_thread_init'
> Indirectly caused by:
> if(!Glib::thread_supported()) Glib::thread_init();
>
> The libraries which have been linked against were determined with `pkg-config glibmm-2.4 --libs`:
> -lglibmm-2.4 -lgobject-2.0 -lsigc-2.0 -lglib-2.0
>
> but maybe should include libraries required for gthread-2.0 ?
> pkg-config gthread-2.0 --libs
> -pthread -lgthread-2.0 -lrt -lglib-2.0
>

You should add `pkg-config gthread-2.0 --libs` to your LDFLAGS, and
probably `pkg-config gthread-2.0 --cflags` to your CFLAGS for
consistancy.  glibmm is following the same convention as GLib in this
regard.

> Especially since linking against "gthread" instead of "gthread-2.0" causes applications to malfunction. Actually, I am still unsure which libraries to link against... So making this easier would be a good thing.
>

Sound good, but it's been this way from the beginning.  So I'm
downgrading severity to wishlist.  I'll contact upstream for further
information.

>
>
> -- System Information:
> Debian Release: lenny/sid
>   APT prefers testing
>   APT policy: (650, 'testing')
> Architecture: i386 (i686)
>
> Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages libglibmm-2.4-dev depends on:
> ii  libglib2.0-dev                2.14.6-1   Development files for the GLib lib
> ii  libglibmm-2.4-1c2a            2.14.2-4   C++ wrapper for the GLib toolkit (
> ii  libsigc++-2.0-dev             2.0.18-2   type-safe Signal Framework for C++
> ii  pkg-config                    0.22-1     manage compile and link flags for 
>
> libglibmm-2.4-dev recommends no packages.
>
> -- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20080316/eb40ede0/attachment-0001.pgp 


More information about the pkg-gnome-maintainers mailing list