[cairo] Cairomm examples / autotools

Behdad Esfahbod behdad at cs.toronto.edu
Tue Jan 24 17:51:28 PST 2006


On Tue, 24 Jan 2006, Jonathon Jongsma wrote:

> Now that we have multiple surface types wrapped in cairomm, I'm
> working on adding a few examples / tests for different surfaces (e.g.
> pdf, ps, svg, etc).  There already exists a single example (in the
> examples/ directory) for writing a surface to png and it works fine.
>
> The basic setup is that there is a subdirectory for each example
> program.  These example programs link to the .la file in the cairomm
> directory.
>
> When I try to create a pdf example (attached is a patch to the
> configure.in and examples/Makefile.am files and a tar.gz file to
> extract into the examples/ directory), it compiles cleanly and without
> complaint.  When I run the program, however, i get the following
> error:
>
> $ ./example_pdf_file
> /home/jonathon/.cvs/gnome2/cairomm/examples/pdf-surface/.libs/lt-example_pdf_file:
> symbol lookup error:
> /home/jonathon/.cvs/gnome2/cairomm/cairomm/.libs/libcairomm-1.0.so.0:
> undefined symbol: cairo_pdf_surface_create
>
> however, if I install cairomm (instead of linking to the .la file in
> the working directory), and then build the example manually with the
> following command:
> $  g++ `pkg-config --cflags --libs cairomm-1.0` main.cc
>
> I get:
> $ ./a.out
> Wrote PDF file "image.pdf"
>
> Can anybody point me in the right direction?  What am I doing wrong here?

You need to do example_pdf_file_LDADD = path-to-cairomm.la such
that libtool detects what you are doing and create a wrapper for
example_pdf_file to set correct LD_LIBRARY_PATH...  I have no
idea how the png_file example is working without it.

See pango/examples for example...


My .02CADs.

--behdad
http://behdad.org/

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


More information about the cairo mailing list