diff --git a/doc/langref.html.in b/doc/langref.html.in index 30dbbb604e5d..493703548612 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -10901,9 +10901,15 @@ export fn add(a: i32, b: i32) i32 { } {#code_end#}
To make a static library:
- {#shell_samp#}$ zig build-lib mathtest.zig{#end_shell_samp#} + {#shell_samp#}$ zig build-lib -femit-h mathtest.zig{#end_shell_samp#}To make a shared library:
- {#shell_samp#}$ zig build-lib mathtest.zig -dynamic{#end_shell_samp#} + {#shell_samp#}$ zig build-lib -femit-h mathtest.zig -dynamic{#end_shell_samp#} ++ The -femit-h flag is necessary in order to generate the mathtest.h file. + The generated C header file includes the zig.h file that must be copied + to the project directory, as an example using jq: +
+ {#shell_samp#}cp $(zig env | jq -r .lib_dir)/zig.h .{#end_shell_samp#}Here is an example with the {#link|Zig Build System#}:
{#syntax_block|c|test.c#}// This header is generated by zig from mathtest.zig #include "mathtest.h"