Skip to content

Documentation issue in section "Exporting a C Library"  #6753

@robertblackwell

Description

@robertblackwell

The example given in the Documentation section Exporting C Libraries does not build (at least when I try). The required C headers file (mathtest.h) is not found.

Need to add -femit-h to

zig build-lib mathtest.zig  -femit-h 

and or add the line

lib.emit_h = true

following

const lib = b.addSharedLibrary("mathtest", "mathtest.zig", version(1,0,0));

in the build.zig file.

There is, I think, a similar issue with the example under the heading Mixing Object Files because it fails to build for a similar reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsemit-hThis issue is related to generating .h files for C interop

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions