[cairo] Having trouble getting started - can you advise if I should perserve

Simon Sapin simon.sapin at exyr.org
Sun Jan 13 23:28:00 PST 2013


Le 14/01/2013 08:19, peter shadbolt a écrit :
> No - that would be a bad assumption on my part.  When I tried compiling
> my program I encountered
> fatal error cairo.h no such file or directory
> so I assumed I needed to download and install the libraries.
> I'll look more closely at that error.

You need to tell your compiler where to find cairo.h with something like 
-I/usr/include/cairo.

However you probably need more of these compiler flags.
On Linux, the pkg-config can give them to you. In turn, you should tell 
pkg-config which cairo backends you’ll be using.

gcc $(pkg-config --cflags --libs cairo cairo-ft cairo-pdf) …

I’m sure you can find many resources on the web about building C 
programs, header files, compiler flags, pkg-config etc.

-- 
Simon Sapin


More information about the cairo mailing list