-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation issue in section "Exporting a C Library" #6753
Comments
Adding Line 2708 in d44486b
|
I am using zig 0.6.0+288198e51. It does produce a .h file. // TODO we would like to #include "mathtest.h" here but this feature has been disabled in in zig/test/shared_library/test.c So at this point zig does not deliver "One of the primary use cases for Zig is exporting a library with the C ABI" without writing the libraries .h file by hand. AND the docs don't tell users that. |
It probably should be mentioned in the docs, however, we're both trying to use daily builds from the master branch. In theory when In the meantime, my solution will probably be to use the version you mentioned. |
➤ zig version
0.10.0-dev.2617+47c4d4450
zig build-lib src/zigmath.zig -femit-h
warning(compilation): -femit-h is not available in the stage1 backend; no .h file will be produced
|
# cd this-dir/; do:
docker run --platform linux/x86_64 -v $PWD:/app euantorano/zig:0.6.0 build-lib src/mathtest.zig -femit-h
|
It is possible to export to C only using stage2. So if you download version 0.9.1 or higher, add the Example: https://jedi.sh/zigo |
Still doesn't work as of 0.11.0-dev.2969+855493bb8 |
site doesn't work |
Old reference. Archived website: |
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
toand or add the line
following
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.
The text was updated successfully, but these errors were encountered: