ravenspoint
ravenspoint

Reputation: 20586

GTK build missing include file gdk-pixbuf/gdk-pixbuf.h

I have installed GTK, following the instructions here: http://www.gtk.org/download/win32_tutorial.php

Now I am trying to build a GTK hello world program from here: https://developer.gnome.org/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD

I hit this error:

In file included from C:/gtk/include/gtk-3.0/gdk/gdkcairo.h:28:0,
                 from C:/gtk/include/gtk-3.0/gdk/gdk.h:33,
                 from C:/gtk/include/gtk-3.0/gtk/gtk.h:30,
                 from gtk_hello_world.c:1:
C:/gtk/include/gtk-3.0/gdk/gdkpixbuf.h:34:35: fatal error: gdk-pixbuf/gdk-pixbuf
.h: No such file or directory
 #include <gdk-pixbuf/gdk-pixbuf.h>
                          ^

This seems to be the same problem as How to repair "error: gdk-pixbuf/gdk-pixdata.h: No such file or directory?" but I do not understand the answer to that question.

Here is the command line to the compiler

C:\Users\James\code\smartone>gcc -o hello.exe gtk_hello_world.c -m32 -mms-bitfie
lds -IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -
IC:/tk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixman-1 -IC:/gtk
/inlude -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng15 -I
C:/gtk/include/libpng15 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include
-LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshel32 -lole32 -Wl,-luuid -lpango
cairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpang
o-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdkpixbuf-2.0 -lgio-2.0 -lgobject-
2.0 -lglib-2.0

This was mostly generated using

pkg-config --cflags --libs gtk+-3.0
-mms-bitfields -IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/
pango-1.0 -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixma
n-1 -IC:/gtk/include -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/includ
e/libpng15 -IC:/gtk/include/gdk-pixbuf-2.0 -IC:/gtk/include/libpng15 -IC:/gtk/in
clude/glib-2.0 -IC:/gtk/lib/glib-2.0/include -LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi3
2 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetyp
e -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobjec
t -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl

Upvotes: 2

Views: 5418

Answers (2)

xdmtk
xdmtk

Reputation: 31

I know this question is extremely old, but I ran into this error while compiling xscreensaver from source on Debian Stretch and found that the missing package was libglade2-dev, despite all intuition that might suggest it is libgdk-pixbuf2.0-dev

Hope this might help the next guy looking for an answer to this one.

Upvotes: 1

liberforce
liberforce

Reputation: 11454

We need the exact gcc command line that caused the error. If the file is not found, it's because pkg-config couldn't pass to gcc the right location of your gdk-pixbuf installation.

First run pkg-config --list-all | grep gdk-pixbuf to get the exact name of the gdk-pixbuf module on you machine (for me it's gdk-pixbuf-2.0). The use that name, to check what directory pkg-config thinks gdk-pixbuf is installed:

pkg-config --cflags gdk-pixbuf-2.0

returns for me:

-pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng15 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include

The -I tells here to gcc to include directory /usr/include/gdk-pixbuf-2.0. And this is where your file are not.

Upvotes: 0

Related Questions