How to resolve 'gdk-pixbuf/gdk-pixbuf.h: No such file or directory'

I am trying to compile chromium source on ubuntu 10.10. But I get this "gdk-pixbuf/gdk-pixbuf.h: No such file or directory" error. Can you please tell how can I fix it? I have the '/usr/include/gtk-2.0/gdk/gdkpixbuf.h', so I should have gdkpixbuf dev package right? (since it said '/usr/include/gtk-2.0/gdk/gdkpixbuf.h:37: fatal error: gdk-pixbuf/gdk-pixbuf.h: No such file or directory'

$ make out/Debug/chrome
  CXX(target) out/Debug/obj.target/app_base/app/active_window_watcher_x.o
In file included from /usr/include/gtk-2.0/gdk/gdkcairo.h:28,
                 from /usr/include/gtk-2.0/gdk/gdk.h:33,
                 from app/active_window_watcher_x.cc:6:
/usr/include/gtk-2.0/gdk/gdkpixbuf.h:37: fatal error: gdk-pixbuf/gdk-pixbuf.h: No such file or directory
compilation terminated.
make: *** [out/Debug/obj.target/app_base/app/active_window_watcher_x.o] Error 1

Solution 1:

There's a generic “teach a man to fish…” answer here, too:

Install the apt-file package, and use it to search for the package containing the file you need. In this case, you get:


└─(14:36:%)── apt-file search gdk-pixbuf/gdk-pixbuf.h
libgdk-pixbuf2.0-dev: /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h
libgfcui-dev: /usr/include/gfc-2.0/gfc/gdk-pixbuf/gdk-pixbuf.hh
lsb-build-desktop3: /usr/include/lsb3/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h

which has (surprisingly) returned more than one result. libgdk-pixbuf2.0-dev is the package you're after.

Solution 2:

I have both of the referenced packages installed and have had similar issues. In 10.10 it seems that the gdk-pixbuf includes are stored in their own directory off of /usr/include, whereas in previous versions they had been lumped in with gtk-2.0. If you have installed libgtk2.0-dev and libgdk-pixbuf2.0-dev then you'll need to execute:

sudo ln -s /usr/include/gdk-pixbuf-2.0/gdk-pixbuf /usr/include/gtk-2.0/gdk-pixbuf

This will create a symbolic link to the new gdk-pixbuf directory where it had been located previously.