Skip to content

Error when build c/c++ dependencies: can't found #246

Answered by polarathene
zooeywm asked this question in Q&A
Discussion options

You must be logged in to vote

Assuming that X11/Xatom.h is found at /usr/include, this should be fixable by including the system directory (which zig excludes when -nostdinc / -target is configured which cargo zigbuild sets).

This should work for you (RUSTFLAGS may not be necessary sometimes):

CFLAGS='-isystem /usr/include' RUSTFLAGS='-L /usr/lib64' cargo zigbuild --release --target x86_64-unknown-linux-gnu

Zig should provide it's own headers and those should be preferred when building for older glibc. You would not want to use -I /usr/include which would introduce conflicts. This should provide fallback to /usr/include for additional header files from other system packages.

Full explanation

The default system libs like

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zooeywm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants