← All tasks
cpppolybar/polybar #3220Not a task: not reproduced

[Bug]: Missing freetype library dependency

envgap__polybar__polybar-3220

01 / FAILURE SIGNATURE

As reported upstream

/usr/bin/ld: libs/libpoly.a(renderer.cpp.o): undefined reference to symbol 'FT_Init_FreeType'
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
9476ad80b80ae1b5ad29717907bd328becf8f502
Manifest
src/CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

polybar/polybar #3220 · read the original issue
### Checklist

- [x] I have read the appropriate section in the [contributing guidelines](https://github.com/polybar/polybar/blob/master/CONTRIBUTING.md)
- [x] I believe this issue is a problem with polybar itself and not a misconfiguration on my part
- [x] I have searched for other open and closed [issues](https://github.com/polybar/polybar/issues?q=is%3Aissue) that may have already reported this problem
- [x] I have checked the [known issues](https://github.com/polybar/polybar/wiki/Known-Issues) page for this problem.
- [x] I have followed the [debugging guide](https://github.com/polybar/polybar/wiki/Debugging-your-Config) to narrow down the problem to a minimal config.

### Steps to reproduce

1. Check out master or the `3.7.2` tag on recent Arch Linux
2. Follow the build instructions

(Or, equivalently, attempt to use Arch's current PKGBUILD.)

### Minimal config

```dosini
This fails well before the config becomes relevant.
```

### Polybar log

```text
The program cannot compile, and thus produces no log.
```

### Expected behavior

Program builds.

### Actual behavior

```
FAILED: bin/polybar
: && /usr/bin/c++ -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override -Wl,--dependency-file=bin/CMakeFiles/polybar.dir/link.d bin/CMakeFiles/polybar.dir/main.cpp.o -o bin/polybar  libs/libpoly.a  -lcairo  -lfontconfig  lib/xpp/libxpp.a  /usr/lib/libxcb.so  /usr/lib/libxcb-ewmh.so  /usr/lib/libxcb-icccm.so  /usr/lib/libxcb-util.so  /usr/lib/libxcb-image.so  /usr/lib/libxcb-randr.so  /usr/lib/libxcb-composite.so  /usr/lib/libxcb-xkb.so  -luv  lib/i3ipcpp/libi3ipc++.a  -ljsoncpp  -lasound  -lcurl  -lmpdclient  -lnl-genl-3  -lnl-3  -lpulse  -lxcb-randr  -lxcb-composite  -lxcb-xkb  -lxcb-cursor  -lxcb-xrm  -lxcb && :
/usr/bin/ld: libs/libpoly.a(renderer.cpp.o): undefined reference to symbol 'FT_Init_FreeType'
/usr/bin/ld: /usr/lib/libfreetype.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```

### Window Manager and Version

requiring these fields for build errors is odd

### Linux Distribution

Arch

### Polybar version

```text
`polybar: command not found` ;-)

Reproduced on both the `3.7.2` tag and current master, which happens to be `9476ad80b80ae1b5ad29717907bd328becf8f502`
```

### Additional Context / Screenshots

Since portions of the code seem to use Freetype APIs directly, it looks like the link may have been succeeding accidentally due to link order or other transitive dependency fun.

Adding `find_package(Freetype REQUIRED)` in `libpoly.cmake` and then `freetype` to its `target_link_libraries` list lets it build.

I've done this in a fork, but the contributor guidelines are very clear about wanting an issue report before a PR.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]