[cairo] Getting up and Running with Cairo (OS X)

laurens at cs.york.ac.uk laurens at cs.york.ac.uk
Wed Nov 14 03:55:41 PST 2007


Hi,

I am in need of a little bit of help getting Cairo up and running.

I am running OS X (Leopard) and I have installed Cairo via MacPorts, and
indeed MacPorts reports Cairo is installed:

"cairo @1.4.10_0 (active)"

I am trying to compile a very simple app just to check everything is
working, and have used the following command:

cc -o hello -L/opt/local/lib -I/opt/local/include/cairo hello.c

To compile the 'minimal C program' from http://cairographics.org/FAQ/.

Unfortunately I get the following errors at compile time:

Undefined symbols:
  "_cairo_select_font_face", referenced from:
      _main in cc40eyci.o
  "_cairo_set_font_size", referenced from:
      _main in cc40eyci.o
  "_cairo_move_to", referenced from:
      _main in cc40eyci.o
  "_cairo_surface_destroy", referenced from:
      _main in cc40eyci.o
  "_cairo_set_source_rgb", referenced from:
      _main in cc40eyci.o
  "_cairo_surface_write_to_png", referenced from:
      _main in cc40eyci.o
  "_cairo_image_surface_create", referenced from:
      _main in cc40eyci.o
  "_cairo_show_text", referenced from:
      _main in cc40eyci.o
  "_cairo_create", referenced from:
      _main in cc40eyci.o
  "_cairo_destroy", referenced from:
      _main in cc40eyci.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I am wanting to use Cairo just to export SVG documents (created inside my
app) to PNG or similar raster format. I am not wanting to display them
live to the user at this stage, just output to disk (so I believe I don't
need Quartz support?).

Am I right that I should be able to get this working fairly easily under
OS X?

Any insight into the above compile problem will make my day,

Many thanks,

- Peter



More information about the cairo mailing list