-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
Milestone
Description
On my system, @cImport(@cInclude("stdio.h"))
works, but @cImport(@cInclude("gmp.h"))
doesn't. gmp.h
is in /usr/include/x86_64-linux-gnu
, and stdio.h
is in /usr/include
. I'm running a simple test file with zig test filename.zig --library gmp --library c
:
// run with: zig test filename.zig --library gmp --library c
const gmp = @cImport(@cInclude("gmp.h"));
test "asdasd" {
var num: gmp.mpz_t = undefined;
gmp.mpz_init_set_ui(&num[0], 123);
defer gmp.mpz_clear(&num[0]);
_ = gmp.gmp_printf(c"'%Zd' should be '-123'\n", &num[0]);
}
This worked in 0.3.0+9c5852aa
, but is broken in 0.3.0+0a8a7a57
. On this system, zig is cloned to ~/sourcestuff/zig
and built there, then bin
and lib
are copied to ~/zig/
(~/zig/bin
is in $PATH
).
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.