Closed pepa65 closed 1 year ago
Thanks!
Yes, the build file was for Zig 0.10.
I've updated it for Zig 0.11. Note that you now need to use the zig build -Drelease
command to get a release build.
Thank you!
Perhaps you'd like me to open a new issue for this, but if I do zig build -Drelease
:
zig build-exe dsvpn Debug native: error: error(compilation): clang failed with stderr: In file included from /data/git/dsvpn/src/os.c:1:
In file included from /data/git/dsvpn/include/os.h:4:
/data/git/dsvpn/include/vpn.h:4:10: fatal error: 'sys/ioctl.h' file not found
error(compilation): clang failed with stderr: In file included from /data/git/dsvpn/src/vpn.c:1:
/data/git/dsvpn/include/vpn.h:4:10: fatal error: 'sys/ioctl.h' file not found
error(compilation): clang failed with stderr: /data/git/dsvpn/src/charm.c:2:10: fatal error: 'stdlib.h' file not found
zig build-exe dsvpn Debug native: error: the following command failed with 3 compilation errors:
/opt/zig/zig build-exe /data/git/dsvpn/src/charm.c /data/git/dsvpn/src/os.c /data/git/dsvpn/src/vpn.c --cache-dir /data/git/dsvpn/zig-cache --global-cache-dir /home/pp/.cache/zig --name dsvpn -I /data/git/dsvpn/include -D _GNU_SOURCE=1 --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install dsvpn transitive failure
└─ zig build-exe dsvpn Debug native 3 errors
/data/git/dsvpn/src/os.c:1:1: error: unable to build C object: clang exited with code 1
/data/git/dsvpn/src/vpn.c:1:1: error: unable to build C object: clang exited with code 1
/data/git/dsvpn/src/charm.c:1:1: error: unable to build C object: clang exited with code 1
I'm guessing I am missing some dependency now..?
I do have: libc6-dev:amd64
: /usr/include/x86_64-linux-gnu/sys/ioctl.h
and /usr/include/x86_64-linux-gnu/bits/stdlib.h
Ah, sorry for that, I didn't try on linux.
Can you git pull
and try again?
That does the trick!
I'm guessing the -Drelease
addition is just to optimize the build (and make it smaller)?
Yes, it's going to be way smaller and faster with -Drelease
.
zig build
:zig version
: 0.11.0