OF 0.74 dependencies.sh error with ofCairoRenderer

I’ve seen this issue mentioned two other places with no fix. When I run the dependencies.sh script, everything runs fine except when ofCairoRenderer tries to call 3 constants that are no-where to be found in cairo.h. Any ideas on a fix would be greatly appreciated.

  
CairoRenderer.o -o obj/Debug/openFrameworks/graphics/ofCairoRenderer.o -c ../../../openFrameworks/graphics/ofCairoRenderer.cpp  
../../../openFrameworks/graphics/ofCairoRenderer.cpp: In member function 'virtual void ofCairoRenderer::setBlendMode(ofBlendMode)':  
../../../openFrameworks/graphics/ofCairoRenderer.cpp:613: error: 'CAIRO_OPERATOR_MULTIPLY' was not declared in this scope  
../../../openFrameworks/graphics/ofCairoRenderer.cpp:618: error: 'CAIRO_OPERATOR_SCREEN' was not declared in this scope  
../../../openFrameworks/graphics/ofCairoRenderer.cpp:623: error: 'CAIRO_OPERATOR_DIFFERENCE' was not declared in this scope  
../../../openFrameworks/graphics/ofCairoRenderer.cpp: At global scope:  
../../../openFrameworks/graphics/ofCairoRenderer.cpp:10: warning: 'void helper_quadratic_to(cairo_t*, double, double, double, double)' defined but not used  
make: *** [obj/Debug/openFrameworks/graphics/ofCairoRenderer.o] Error 1  
  

I got the same problem, when I try to run the “install_dependencies.sh” of OF 0.74 under Ubuntu 10.04.

Changing the ofCairoRenderer Header, as pointed out here was not working.

The output of

  
pkg-config cairo --cflags  

is:

  
-D_REENTRANT -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12  

does this also occur if you use current develop: https://github.com/openframeworks/openFrameworks/archive/develop.zip ?

I tried the latest nightly version from 24.4.2013 (link) and got a little bit different error, which also seems to be related to the Cairo Renderer.

Maybe this is also a problem related to zlib, but I got zlib installed (with package zlib1g).
There is no actual “zlib” package in the Ubuntu Package archive.

  
...  
Package zlib was not found in the pkg-config search path.  
Perhaps you should add the directory containing `zlib.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'zlib' found  
Compiling ../../../libs/openFrameworks/graphics/ofPixels.cpp  
mkdir -p ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics  
g++ -g3 -Wall -fexceptions -march=native -mtune=native -DOF_USING_GTK -I../../../libs/fmodex/include -I../../../libs/kiss/include -I../../../libs/openssl/include -I../../../libs/openssl/include/openssl -I../../../libs/poco/include -I../../../libs/portaudio/include -I../../../libs/rtAudio/include -I../../../libs/tess2/include -I../../../libs/openFrameworks -I../../../libs/openFrameworks/graphics -I../../../libs/openFrameworks/communication -I../../../libs/openFrameworks/app -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/3d -I../../../libs/openFrameworks/types -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/math -I../../../libs/openFrameworks/sound -I../../../libs/openFrameworks/utils -MMD -MP -MF ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofPixels.d -MT../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofPixels.o -o ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofPixels.o -c ../../../libs/openFrameworks/graphics/ofPixels.cpp  
Package zlib was not found in the pkg-config search path.  
Perhaps you should add the directory containing `zlib.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'zlib' found  
Compiling ../../../libs/openFrameworks/graphics/ofCairoRenderer.cpp  
mkdir -p ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics  
g++ -g3 -Wall -fexceptions -march=native -mtune=native -DOF_USING_GTK -I../../../libs/fmodex/include -I../../../libs/kiss/include -I../../../libs/openssl/include -I../../../libs/openssl/include/openssl -I../../../libs/poco/include -I../../../libs/portaudio/include -I../../../libs/rtAudio/include -I../../../libs/tess2/include -I../../../libs/openFrameworks -I../../../libs/openFrameworks/graphics -  
...  

this continuous with all kind of “ofCairoRenderer”-Erros and ends with:

  
../../../libs/openFrameworks/graphics/ofCairoRenderer.cpp:1307: error: 'cairo_set_matrix' was not declared in this scope  
make[1]: *** [../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofCairoRenderer.o] Error 1  
make: *** [Debug] Error 2  
there has been a problem compiling Debug OF library  

I also tried the develop branch file, from your Link.
This got me further (guessing from the output). But I got other errors.

  
  
...  
No package 'zlib' found  
Compiling ../../../libs/openFrameworks/graphics/ofImage.cpp  
mkdir -p ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics  
g++ -g3 -Wall -fexceptions -march=native -mtune=native -DOF_USING_GTK -I../../../libs/cairo/include -I../../../libs/cairo/include/libpng15 -I../../../libs/cairo/include/pixman-1 -I../../../libs/cairo/include/cairo -I../../../libs/fmodex/include -I../../../libs/kiss/include -I../../../libs/openssl/include -I../../../libs/openssl/include/openssl -I../../../libs/poco/include -I../../../libs/portaudio/include -I../../../libs/rtAudio/include -I../../../libs/tess2/include -I../../../libs/openFrameworks -I../../../libs/openFrameworks/graphics -I../../../libs/openFrameworks/communication -I../../../libs/openFrameworks/app -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/3d -I../../../libs/openFrameworks/types -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/math -I../../../libs/openFrameworks/sound -I../../../libs/openFrameworks/utils -MMD -MP -MF ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofImage.d -MT../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofImage.o -o ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofImage.o -c ../../../libs/openFrameworks/graphics/ofImage.cpp  
Package zlib was not found in the pkg-config search path.  
Perhaps you should add the directory containing `zlib.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'zlib' found  
Compiling ../../../libs/openFrameworks/graphics/ofTessellator.cpp  
mkdir -p ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics  
g++ -g3 -Wall -fexceptions -march=native -mtune=native -DOF_USING_GTK -I../../../libs/cairo/include -I../../../libs/cairo/include/libpng15 -I../../../libs/cairo/include/pixman-1 -I../../../libs/cairo/include/cairo -I../../../libs/fmodex/include -I../../../libs/kiss/include -I../../../libs/openssl/include -I../../../libs/openssl/include/openssl -I../../../libs/poco/include -I../../../libs/portaudio/include -I../../../libs/rtAudio/include -I../../../libs/tess2/include -I../../../libs/openFrameworks -I../../../libs/openFrameworks/graphics -I../../../libs/openFrameworks/communication -I../../../libs/openFrameworks/app -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/3d -I../../../libs/openFrameworks/types -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/math -I../../../libs/openFrameworks/sound -I../../../libs/openFrameworks/utils -MMD -MP -MF ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofTessellator.d -MT../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofTessellator.o -o ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofTessellator.o -c ../../../libs/openFrameworks/graphics/ofTessellator.cpp  
Package zlib was not found in the pkg-config search path.  
Perhaps you should add the directory containing `zlib.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'zlib' found  
Compiling ../../../libs/openFrameworks/graphics/ofTrueTypeFont.cpp  
mkdir -p ../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics  
g++ -g3 -Wall -fexceptions -march=native -mtune=native -DOF_USING_GTK -I../../../libs/cairo/include -I../../../libs/cairo/include/libpng15 -I../../../libs/cairo/include/pixman-1 -I../../../libs/cairo/include/cairo -I../../../libs/fmodex/include -I../../../libs/kiss/include -I../../../libs/openssl/include -  
...  
  

ends with

  
  
...  
/usr/include/freetype2/freetype/fttrigon.h:266: error: expected constructor, destructor, or type conversion before 'FT_Vector_Rotate'  
/usr/include/freetype2/freetype/fttrigon.h:287: error: expected constructor, destructor, or type conversion before '(' token  
/usr/include/freetype2/freetype/fttrigon.h:312: error: expected constructor, destructor, or type conversion before 'FT_Vector_Polarize'  
/usr/include/freetype2/freetype/fttrigon.h:338: error: expected constructor, destructor, or type conversion before 'FT_Vector_From_Polar'  
In file included from /usr/include/fontconfig/fontconfig.h:29,  
                 from ../../../libs/openFrameworks/graphics/ofTrueTypeFont.cpp:11:  
/usr/include/sys/stat.h:105: error: expected constructor, destructor, or type conversion before 'extern'  
make[1]: *** [../../../libs/openFrameworksCompiled/lib/linux/obj/Debug/libs/openFrameworks/graphics/ofTrueTypeFont.o] Error 1  
make: *** [Debug] Error 2  
there has been a problem compiling Debug OF library  
  

Since the zlib problem seems to occur all the time, maybe this is the reason?
But since I got zlib installed (zlib1g package), I though maybe there is something else.

I will try to create a zlib.pc file, as pointed out in the installation process.

I created a zlib.pc unser /usr/lib/pkgconfig which looks like that …

  
prefix=/usr  
 libdir=/usr/lib  
 includedir=/usr/include  
 sharedlibdir=/usr/lib  
 Name: zlib  
 Description: zlib compression library  
 Version: 1.2.3  
 Requires:  
 Libs: -L${libdir} -L${sharedlibdir} -lz  
 Cflags: -I${includedir}  

Then I tried the last nightly linux version again and it seemed to work, since it was running much further then before. So taking a current version and fixing the zlib problem seems to work so far.

But then I got an error again, which is different and related to the Project Generator.

  
LayeredConfiguration.cpp:(.text+0x3af): undefined reference to `std::__detail::_List_node_base::_M_unhook()'  
../../../libs/poco/lib/linux/libPocoUtil.a(LayeredConfiguration.o): In function `Poco::Util::LayeredConfiguration::add(Poco::Util::AbstractConfiguration*, int, bool, bool)':  
LayeredConfiguration.cpp:(.text+0x51d): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
../../../libs/poco/lib/linux/libPocoXML.a(Document.o): In function `Poco::XML::Document::collectGarbage()':  
Document.cpp:(.text+0x2e6): undefined reference to `std::__detail::_List_node_base::_M_unhook()'  
../../../libs/poco/lib/linux/libPocoXML.a(Document.o): In function `Poco::XML::Document::~Document()':  
Document.cpp:(.text+0xb76): undefined reference to `std::__detail::_List_node_base::_M_unhook()'  
../../../libs/poco/lib/linux/libPocoXML.a(Document.o): In function `Poco::AutoReleasePool<Poco::XML::DOMObject>::~AutoReleasePool()':  
Document.cpp:(.text._ZN4Poco15AutoReleasePoolINS_3XML9DOMObjectEED2Ev[_ZN4Poco15AutoReleasePoolINS_3XML9DOMObjectEED5Ev]+0x2e): undefined reference to `std::__detail::_List_node_base::_M_unhook()'  
../../../libs/poco/lib/linux/libPocoXML.a(ElementsByTagNameList.o): In function `Poco::XML::ElementsByTagNameList::autoRelease()':  
ElementsByTagNameList.cpp:(.text+0x3d): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
../../../libs/poco/lib/linux/libPocoXML.a(ElementsByTagNameList.o): In function `Poco::XML::ElementsByTagNameListNS::autoRelease()':  
ElementsByTagNameList.cpp:(.text+0x15d): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
../../../libs/poco/lib/linux/libPocoXML.a(AbstractNode.o): In function `Poco::XML::AbstractNode::autoRelease()':  
AbstractNode.cpp:(.text+0x5a5): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
../../../libs/poco/lib/linux/libPocoXML.a(AttrMap.o): In function `Poco::XML::AttrMap::autoRelease()':  
AttrMap.cpp:(.text+0xad): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
../../../libs/poco/lib/linux/libPocoXML.a(ChildNodesList.o): In function `Poco::XML::ChildNodesList::autoRelease()':  
ChildNodesList.cpp:(.text+0xcd): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
../../../libs/poco/lib/linux/libPocoXML.a(Event.o):Event.cpp:(.text+0x35): more undefined references to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)' follow  
../../../libs/poco/lib/linux/libPocoXML.a(EventDispatcher.o): In function `_ZNSt4listIN4Poco3XML15EventDispatcher17EventListenerItemESaIS3_EE5eraseESt14_List_iteratorIS3_E.isra.28':  
EventDispatcher.cpp:(.text+0x1b): undefined reference to `std::__detail::_List_node_base::_M_unhook()'  
../../../libs/poco/lib/linux/libPocoXML.a(EventDispatcher.o): In function `Poco::XML::EventDispatcher::addEventListener(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::XML::EventListener*, bool)':  
EventDispatcher.cpp:(.text+0x1a9): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
../../../libs/poco/lib/linux/libPocoXML.a(DTDMap.o): In function `Poco::XML::DTDMap::autoRelease()':  
DTDMap.cpp:(.text+0xfd): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'  
collect2: ld returned 1 exit status  
make[1]: *** [bin/projectGeneratorSimple] Error 1  
make: *** [Release] Error 2  
there has been a problem compiling the projectGenerator  

This error can be fixed by updating to gcc version 4.6

two theories on that zlib problem: maybe you just need zlibg1-dev? alternatively, it could be some weird linking where we’re missing a flag in the makefile or somethign like that.
Arturo, do you know more?