[cairo] Private Headers

Behdad Esfahbod behdad at behdad.org
Thu Aug 21 10:12:22 PDT 2008


mike at liquido2.com wrote:
> I have a bit of a silly question.  I recently ported cairo to an Amiga  
> architecture.  The library seems to build just fine.  But when  
> attempting to write a program using Cairo I getting a compiler error  
> stating the struct _cairo is not defined in cairo.h.
> 
> After some investigating, I see that this is true.  struct _cairo is  
> defined in cairo-private.h which is not included with cairo.h.
> 
> I'm guessing the Cairo is using some type of library data  
> encapsulation and that these private types are resolved at link- or  
> run-time.  Is this correct?
> 
> If the above is correct, what can be done about systems with libraries  
> that do not support structure definitions inside a library?  Should I  
> just include the appropriate private headers before cairo.h or is  
> there a more elegant way?

What cairo does is very common and standard in C.  The issue you are seeing
may merely be caused by a typo in your program.  Are you writing:

  cairo_t cr;

when you should instead be writing:

  cairo_t *cr;

?

Have fun with cairo!

behdad



> Thanks,
> Mike
> 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
> 


More information about the cairo mailing list