zig-cairo icon indicating copy to clipboard operation
zig-cairo copied to clipboard

Unable to find cairo library when compiling with zig 0.7.0 and 0.7.1

Open jackdbd opened this issue 3 years ago • 1 comments

On Travis CI and on my machine the project fails to build with zig 0.7.0 and 0.7.1 because of a linker error.

lld: error: unable to find library -lcairo
error: LLDReportedFailure
The following command exited with error code 1:
/home/travis/zig/zig test /home/travis/build/jackdbd/zig-cairo/src/cairo.zig --library c --library xcb --library cairo --test-name-prefix debug  --cache-dir /home/travis/build/jackdbd/zig-cairo/zig-cache --name test -I /usr/include/cairo -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/pixman-1 -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/freetype2 -I /usr/include/libpng16 
error: the following build command failed with exit code 1:
/home/travis/build/jackdbd/zig-cairo/zig-cache/o/ad4389c25906a7f44097b436cca0d923/build /home/travis/zig/zig /home/travis/build/jackdbd/zig-cairo /home/travis/build/jackdbd/zig-cairo/zig-cache test
The command "zig build test" exited with 1.

The project builds succesfully with zig 0.6.0 and zig 0.8.0-dev.1032+8098b3f84.

All Travis jobs install the libcairo2-dev using the APT addon.

Here is the output of lsb_release -a on my machine:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:         20.04
Codename:     focal

jackdbd avatar Jan 20 '21 18:01 jackdbd