[cairo] Strange problem with includes

Behdad Esfahbod behdad at behdad.org
Thu Sep 7 07:39:26 PDT 2006

On Wed, 2006-09-06 at 20:31 -0400, Ricardo Markiewicz wrote:
> The attached test-case compile and execute correctly. The SVG
> generated is correctly and I can open with EOG without problems.
> But, if I remove the #include <cairo/cairo-svg.h> the program compile
> (with a gcc warning), the program run fine, but the generated SVG has
> width=0 and height=0.

Most definitely because you are passing integer arguments to
cairo_svg_surface_create while it takes doubles.  So, without
prototypes, it doesn't work.

> Looking at the cairo.h I see no reference to cairo-svg.h, is that intentional?

Yes.  You have to include the header files for backends you want to use.

> In case this help : gcc version 4.1.2


"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"

More information about the cairo mailing list