[cairo] Undefined symbols _cairo_boilerplate_get_target_by_name _cairo_boilerplate_xrealloc _cairo_boilerplate_xmalloc

Ryan Schmidt cairo-2012b at ryandesign.com
Thu Apr 12 16:42:59 PDT 2012


Some users of cairo in MacPorts are reporting this build failure with cairo 1.12 on OS X Lion using the Xcode clang compiler:


Undefined symbols for architecture x86_64:
  "_cairo_boilerplate_get_target_by_name", referenced from:
      _main in cairo_sphinx-sphinx.o
  "_cairo_boilerplate_xrealloc", referenced from:
      _main in cairo_sphinx-sphinx.o
      _recorder in lto.o
  "_cairo_boilerplate_xmalloc", referenced from:
      _main in cairo_sphinx-sphinx.o
      __surface_create in lto.o
      __context_create in lto.o
      _get_surface_size in lto.o
      _recorder in lto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


The full build log (1.1MB) is here:

https://trac.macports.org/attachment/ticket/33827/main.3.log


As an aside, the log shows over 1500 warnings of the form "implicit conversion from enumeration type ... to different enumeration type", along with this uninitialized variable warning:


cairo-scaled-font-subsets.c:526:33: warning: variable 'sub_font_glyph' is uninitialized when used here [-Wuninitialized]
        _cairo_sub_font_glyph_destroy (sub_font_glyph);
                                       ^~~~~~~~~~~~~~
cairo-scaled-font-subsets.c:504:43: note: initialize the variable 'sub_font_glyph' to silence this warning
    cairo_sub_font_glyph_t *sub_font_glyph;
                                          ^
                                           = NULL


I am able to reproduce the build failure when using the MacPorts clang 3.0 compiler on OS X Snow Leopard. But there is no build failure when using OS X Snow Leopard's default Xcode gcc 4.2 compiler.





More information about the cairo mailing list