XO1104: C header cannot be bound
use c "header.h" reads the header with clang’s AST dump and generates an Xo declaration file and a C adapter (into .xo/cbind/ or $XO_CBIND_DIR). This failed: the header is neither a file relative to the module directory nor on the C include path, clang reported an error in it, a link file does not exist, or the line’s uses names an unknown effect. The message carries the reason. link "x.c" (or .a, .o) is a path relative to the module directory; link "z" (no extension or /) links the library -lz. xo bind --c <header> runs the binding step alone. See core 4.4 and decision 0116.
Example
use c "missing.h" link "missing.c"
fn main(os: Os) uses ffi {
os.stdio.println("hi")
}Fix
use c "zlib.h" link "z"
fn main(os: Os) uses ffi {
os.stdio.println(zlib.zlib_version())
}Run xo explain XO1104 for this text in a terminal, or see
section 10.6 of the specification.