        esac
      ;;
 diff --git a/cpp/Makefile.am b/cpp/Makefile.am
-index f381e58..35f67e4 100644
+index f381e58..8d60e9d 100644
 --- a/cpp/Makefile.am
 +++ b/cpp/Makefile.am
 @@ -5,8 +5,14 @@ INCLUDES =					\

 if BUILD_LIBJPEG
 libjpeg_includes = $(LIBJPEG_CFLAGS)
 endif
diff --git a/cpp/Makefile.in b/cpp/Makefile.in
index 77b8af3..dd19e9a 100644
--- a/cpp/Makefile.in
+++ b/cpp/Makefile.in
@@ -491,8 +491,12 @@ INCLUDES = \

 @BUILD_LIBJPEG_TRUE@libjpeg_includes = $(LIBJPEG_CFLAGS)
 @BUILD_LIBTIFF_TRUE@libtiff_includes = $(LIBTIFF_CFLAGS)
 @BUILD_LIBOPENJPEG_TRUE@libjpeg2000_includes = $(LIBOPENJPEG_CFLAGS)
@@ -540,6 +544,7 @@ libpoppler_cpp_la_CXXFLAGS = \
 
 libpoppler_cpp_la_LIBADD = \
 	$(top_builddir)/poppler/libpoppler.la	\
+	$(top_builddir)/poppler/libpoppler-cairo.la	\
 	$(LIBICONV)
 
 libpoppler_cpp_la_LDFLAGS = -version-info 2:0:2 @create_shared_lib@ @auto_import_flags@
diff --git a/cpp/poppler-document.cpp b/cpp/poppler-document.cpp
index 1c24b47..732c252 100644
--- a/cpp/poppler-document.cpp
