Linker error compiling examples
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 840
- Forks
- 137
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 1
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with cargo run --example render-glyph on Ubuntu 24.04 and review the linked full log, focusing on the undefined XML_GetCurrentLineNumber references from libfontconfig.a. Compare the failing command with the reported RUSTFLAGS="-lexpat" workaround; done means the example links and runs without manually adding that flag.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust, ubuntu
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100