You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It prints -1 as output with -Dtarget=native-native-gnu but on -Dtarget=native-native-msvc I get the following compiler error:
.\src\main.zig:2:11: error: C import failed
const c = @cImport(@cInclude("stdio.h"));
^
.\zig-cache\o\554df7d82185a847c43862003dfc7d3c\cimport.h:1:10: note: 'stdio.h' file not found
#include <stdio.h>
^
.\src\main.zig:5:21: note: referenced here
print("{}\n", .{c.EOF});
^
Here is my output from zig libc:
# The directory that contains `stdlib.h`.
# On POSIX-like systems, include directories be found with: `cc -E -Wp,-v -xc /dev/null`
include_dir=C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt
# The system-specific include directory. May be the same as `include_dir`.
# On Windows it's the directory that includes `vcruntime.h`.
# On POSIX it's the directory that includes `sys/errno.h`.
sys_include_dir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include
# The directory that contains `crt1.o` or `crt2.o`.
# On POSIX, can be found with `cc -print-file-name=crt1.o`.
# Not needed when targeting MacOS.
crt_dir=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64
# The directory that contains `vcruntime.lib`.
# Only needed when targeting MSVC on Windows.
msvc_lib_dir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\lib\x64\
# The directory that contains `kernel32.lib`.
# Only needed when targeting MSVC on Windows.
kernel32_lib_dir=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64
# The directory that contains `crtbeginS.o` and `crtendS.o`
# Only needed when targeting Haiku.
gcc_dir=
Edit: I'd like to add that this used to work on older Zig versions. Currently I'm on zig-windows-x86_64-0.9.0-dev.117+0d022eb1d.
The text was updated successfully, but these errors were encountered:
I would like to add that directly running zig run -lc -Dtarget=native-native-msvc src/main.zig instead of invoking the build script does not have this problem. I checked to make sure when running the build script (with zig build run) and -lc is passed to zig build-exe but even despite that it can't find the headers.
Uh oh!
There was an error while loading. Please reload this page.
With the following program on Windows (I have
exe.linkLibC();
in the build script)It prints
-1
as output with-Dtarget=native-native-gnu
but on-Dtarget=native-native-msvc
I get the following compiler error:Here is my output from
zig libc
:Edit: I'd like to add that this used to work on older Zig versions. Currently I'm on
zig-windows-x86_64-0.9.0-dev.117+0d022eb1d
.The text was updated successfully, but these errors were encountered: