Closed hellodword closed 1 month ago
See https://github.com/ziglang/zig/issues/15107
IMHO, zig cc
isn't in good shape for windows gnu target yet (for example #251), it's better to reproduce your issue using zig cc
directly and report any problems to zig to hopefully get it fixed in upstream.
I think the 0.14.0-dev.850+ddcb7b1c1
contains the zig PR #20138, it brings new issue of missing msvcrt.
it's better to reproduce your issue using
zig cc
directly and report any problems to zig to hopefully get it fixed in upstream
Got it, thanks!
I am attempting to wrap a Rust library and compile it on Linux, then statically link it on both Linux and Windows using CGO.
I plan to use
zig cc -target x86_64-windows-gnu
for a straightforward cross-build experience.The source code I'm utilizing is https://github.com/hellodword/rust-plus-golang/tree/issue-1
The compile command on Linux is
cargo zigbuild --release --target x86_64-pc-windows-gnu
.The CGO compile command is
CGO_ENABLED=1 CC="zig cc -target x86_64-windows-gnu" GOOS=windows go build <...>
.I've searched extensively and tried many approaches, but I keep encountering errors:
0.13.0
or0.14.0-dev.850+ddcb7b1c1
), I consistently face errors when compiling the library:0.10.1
, I can successfully compile the library, but I encounter an error when cross-building the CGO:Here is the reproduce:
Any ideas?