Open vdemichev opened 10 months ago
Please, try replacing to zig cc
over zig c++
or zig build-exe -lc
no -lc++
Zig toolchain can't build libcxx
for MSVC yet.
Zig toolchain can't build
libcxx
for MSVC yet.
Hey
I experience the same issue
I depend on c++ project (Whisper.cpp) and it failed to build / link with the same error with zig and MSVC.
How can I still use it? if I remove -lc++
then It failed with undefined external symbols
Zig toolchain can't build
libcxx
for MSVC yet.Hey I experience the same issue I depend on c++ project (Whisper.cpp) and it failed to build / link with the same error with zig and MSVC. How can I still use it? if I remove
-lc++
then It failed with undefined external symbols
Yes! Currently, replace -lc++
to -lc
on Windows host with winSDK and VC++buildtools installed to zig-clang detect files (include & libs). How? checking, run zig libc
to see vcruntimelib
on msvc_lib_dir
.
And cross-compile (linux/macos to windows-msvc), try use xwin
to download include & libs, like https://github.com/kassane/xwin-zig-test
Yes!
You mean it's possible with MSVC + zig + whisper.cpp?
Currently, replace
-lc++
to-lc
But then it failed to compile because of missing symbols
Windows host with winSDK and VC++buildtools
I have both
zig-clang detect files (include & libs)
What do you mean?
Zig libc gives me:
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.26100.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\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\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.26100.0\ucrt\x64
# The directory that contains `vcruntime.lib`.
# Only needed when targeting MSVC on Windows.
msvc_lib_dir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\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.26100.0\um\x64
# The directory that contains `crtbeginS.o` and `crtendS.o`
# Only needed when targeting Haiku.
gcc_dir=
Zig Version
0.11.0, x64 Windows; same problem with the latest master
Steps to Reproduce and Observed Behavior
Create any cpp file, try to compile with -target native-native-msvc - does not work. Target gnu works fine. Compiling as C code works fine.
Output:
Expected Behavior
I guess it should work? My goal is try to compile a project that relies on third-party code that is MSVC-specific.