Compile error if linking against GTK+ 3 and poppler-glib via pkg-config

Bug #870662 reported by Stefano Facchini
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
poppler (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The following test program (test.cpp):

    #include <gtkmm.h>
    #include <poppler.h>
    int main()
    {
         return 0;
    }

compiled with:

g++ -o test test.cpp `pkg-config --cflags --libs gtkmm-3.0 poppler-glib`

gives the error:

In file included from /usr/include/gdkmm-3.0/gdkmm/window.h:37:0,
                 from /usr/include/gdkmm-3.0/gdkmm.h:28,
                 from /usr/include/gtkmm-3.0/gtkmm.h:92,
                 from test.cpp:1:
/usr/include/gdkmm-3.0/gdkmm/rgba.h: In static member function ‘static Gdk::RGBATraits::CType Gdk::RGBATraits::to_c_type(const CppType&)’:
/usr/include/gdkmm-3.0/gdkmm/rgba.h:251:54: error: return type ‘Gdk::RGBATraits::CType {aka struct _GdkRGBA}’ is incomplete
/usr/include/gdkmm-3.0/gdkmm/rgba.h: In static member function ‘static Gdk::RGBATraits::CType Gdk::RGBATraits::to_c_type(const CType&)’:
/usr/include/gdkmm-3.0/gdkmm/rgba.h:252:54: error: return type ‘Gdk::RGBATraits::CType {aka struct _GdkRGBA}’ is incomplete

Using:
Ubuntu Oneiric 11.10
libgtkmm-3.0-1, libgtkmm-3.0-dev version 3.2.0-0ubuntu1

The same test program compiles just fine with gtkmm-2.4. The equivalent C program linked against gtk+-3.0 also compiles fine.

Moreover, I get no errors with other distributions I tried (Archlinux, openSUSE 12.01), even with gtkmm-3.0

Related branches

description: updated
Revision history for this message
Murray Cumming (murrayc) wrote :

This is just because the current libpoppler-glib-dev depends on libgtk2.0-dev instead of libgtk3.0-dev. It uses GDK in its API, for instance. This would happen to people using GTK+ 3, not just gtkmm 3.

However, GDK is only used by include files when POPPLER_WITH_GDK is defined. POPPLER_WITH_GDK is apparently defined during the poppler build, and I don't think Ubuntu's libpoppler-glib was really built with that defined. So maybe the dependency is unnecessary. Reassigning to libpoppler-glib-dev for investigation there.

If GTK+ (or GDK) really is needed, it would be great if libpoppler was ported to GTK+ 3, but that doesn't seem to have even happened upstream yet.

affects: gtkmm3.0 (Ubuntu) → poppler (Ubuntu)
summary: - Compile error if linking against gtkmm-3.0 and poppler-glib
+ Compile error if linking against GTK+ 3 and poppler-glib via pkg-config
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package poppler - 0.18.4-0ubuntu1

---------------
poppler (0.18.4-0ubuntu1) precise; urgency=low

  * New upstream version:
    - "evince displays the included PDF without rotation" (lp: #711300)
    - Contents of the page is not displayed while it is OK
      with xpdf or acroread (lp: #878715)
  * debian/control:
    - libpoppler-glib-dev shouldn't depends on libgtk-dev, it stopped using
      gdk and uses cairo directly (lp: #870662)
 -- Sebastien Bacher <email address hidden> Thu, 16 Feb 2012 15:36:47 +0100

Changed in poppler (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.