Skip to content

Linker error compiling examples #272

@a-maier

Description

@a-maier

I get a linker error when trying to run any of the examples, e.g. with

cargo run --example render-glyph

The problem are undefined symbols in libfontconfig, for example

  = note: rust-lld: error: undefined symbol: XML_GetCurrentLineNumber
          >>> referenced by fcxml.o:(FcConfigMessage) in archive /usr/lib/x86_64-linux-gnu/libfontconfig.a
          >>> referenced by fcxml.o:(FcConfigMessage) in archive /usr/lib/x86_64-linux-gnu/libfontconfig.a

Here is the full log.

I am running Ubuntu 24.04 with pkg-config, libfreetype-dev, libfontconfig1-dev installed.

A workaround is to manually link to libexpat:

RUSTFLAGS="-lexpat" cargo run --example render-glyph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions