Hey
I’m working on GitHub - thewh1teagle/whisper.zig
it uses whisper.cpp and libsndfile and it works well on macOS
However on Windows it failed with the following error:
error: lld-link: could not open 'libMSVCRT.a': No such file or directory
error: lld-link: could not open 'libOLDNAMES.a': No such file or directory
error: lld-link: could not open 'libmsvcprt.a': No such file or directory
error: the following command failed with 3 compilation errors:
C:\bin\zig\zig.exe build-exe -lwhisper -lggml -lsndfile -ODebug -I D:\whisper.zig\lib\whisper.cpp\src -I D:\whisper.zig\lib\whisper.cpp\src\include -I D:\whisper.zig\lib\whisper.cpp\include -I D:\whisper.zig\lib\whisper.cpp\ggml\include -I D:\whisper.zig\lib\libsndfile\include -L D:\whisper.zig\lib\whisper.cpp\build\src -L D:\whisper.zig\lib\whisper.cpp\build\src\Release -L D:\whisper.zig\lib\whisper.cpp\build\ggml\src -L D:\whisper.zig\lib\whisper.cpp\build\ggml\src\Release -L D:\whisper.zig\lib\libsndfile\build -L D:\whisper.zig\lib\libsndfile\build\Release -Mroot=D:\whisper.zig\src\main.zig -lc++ --cache-dir D:\whisper.zig\.zig-cache --global-cache-dir C:\Users\yaako\AppData\Local\zig --name whisper.zig --zig-lib-dir C:\bin\zig\lib\
Do you know why it tries to link this files? I don’t specified them in zig.build
kj4tmp
November 16, 2024, 8:54am
2
From Google, it looks like libmsvcrt is part of libc. To link it, you can add -lc
to your command.
I already try to link it but it doesn’t find the required files from MSVC
kj4tmp
November 16, 2024, 1:48pm
4
If you want to link libc from MSVC I think you need to use the MSVC target. The default target is gnu which uses MinGW
so -Dtarget=native-windows-msvc
?
For build-exe
the argument might be -target native-windows-msvc
FYI, linking MSVC requires the files to be installed on the computer doing the building, so you would need to install visual studio. MinGW is bundled with zig.
1 Like
Thanks, I didn’t knew that the default target is GNU.
I tried to set the target to msvc and built with:
zig build -Dtarget=native-windows-msvc
But now it failed with:
install
└─ install whisper.zig
└─ zig build-exe whisper.zig Debug native-windows-msvc 1 errors
error: sub-compilation of libcxxabi failed
kj4tmp
November 16, 2024, 2:15pm
6
libcxx kind of sounds like c++? Maybe you need to link libc++.
Here is an example that linked lib c++:
I am creating a new small SDK from scratch in C/C++ and want to use zig as the build system (0.12.0), but this newbie brain doesn’t understand the zig build system, and the Ziglang Build System docs are useless for my scenario. I’ve looked at the “maintain it in zig” blogs and such, but they’re obsolete now. I haven’t found simple examples for how to do this in 0.12.0, only .11.
Apparently there are “modules” now which are entirely undocumented, and the term is not even defined.
structure:
sr…
I use both c and c++ (whiser.cpp)
and link c++ with
exe.linkLibCpp();
exe.linkLibC();
inside build.zig
└─ zig build-exe whisper.zig Debug native-windows-msvc 1 errors
error: sub-compilation of libcxxabi failed
C:\bin\zig\zig.exe build-exe -lwhisper -lggml -lsndfile -ODebug -target native-windows-msvc -mcpu native -I D:\whisper.zig\lib\whisper.cpp\src -I D:\whisper.zig\lib\whisper.cpp\src\include -I D:\whisper.zig\lib\whisper.cpp\include -I D:\whisper.zig\lib\whisper.cpp\ggml\include -I D:\whisper.zig\lib\libsndfile\include -L D:\whisper.zig\lib\whisper.cpp\build\src -L D:\whisper.zig\lib\whisper.cpp\build\src\Release -L D:\whisper.zig\lib\whisper.cpp\build\ggml\src -L D:\whisper.zig\lib\whisper.cpp\build\ggml\src\Release -L D:\whisper.zig\lib\libsndfile\build -L D:\whisper.zig\lib\libsndfile\build\Release -Mroot=D:\whisper.zig\src\main.zig -lc++ -lc --cache-dir D:\whisper.zig\.zig-cache --global-cache-dir C:\Users\yaako\AppData\Local\zig --name whisper.zig --zig-lib-dir C:\bin\zig\lib\
C:\bin\zig\zig.exe : error: sub-compilation of libcxxabi failed
At line:1 char:1
+ C:\bin\zig\zig.exe build-exe -lwhisper -lggml -lsndfile -ODebug -targ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (error: sub-comp...ibcxxabi failed:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
I think that zig doesn’t support link c++ with msvc yet
opened 07:47PM - 25 Jan 24 UTC
bug
os-windows
### Zig Version
0.11.0, x64 Windows; same problem with the latest master
### S… teps 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:
```
PS C:\Temp\Test> gc test.cpp
#include <iostream>
int main() {
std::cout << "Hello World!\n";
return 0;
}
PS C:\Temp\Test> zig version
0.11.0
PS C:\Temp\Test> zig c++ C:/temp/test/test.cpp -target native-native-msvc
Compile C Objects [2/1] zig: zig: zig: warning: warning: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
zig: zig: zig: warning: warning: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
zig: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
zigzig: : warning: warning: zigargument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]: zig: zig: warning: zig:
warning: zigargument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]zig: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]zigwarning: zig: zig: zig: :
zig: warning: warning: warning: zig: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]warning: zigargument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]zigargument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]warning: zig: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]warning:
:
: warning:
argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]warning:
zig: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]warning: warning: zig:
argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]zig:
argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]zig: warning:
zig: zig: warning: warning: warning: zig: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
warning: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]warning:
zig: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
warning:
argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
In file included from C:\Zig\lib\libcxxabi\src/cxa_aux_runtime.cpp:14:
In file included from C:\Zig\lib\libcxx\include/typeinfo:73:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h:137:13: error: target of using declaration conflicts with declaration already in scope
using ::type_info;
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h:73:7: note: target of using declaration
class type_info
^
C:\Zig\lib\libcxxabi\include/cxxabi.h:30:27: note: conflicting declaration
class _LIBCXXABI_TYPE_VIS type_info; // forward declaration
^
1 error generated.
C:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:16:12: error: cannot define or redeclare '~type_info' here because namespace 'std' does not enclose namespace 'type_info'
type_info::~type_info()
~~~~~~~~~~~^
C:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:22:11: error: redefinition of 'bad_cast'
bad_cast::bad_cast() noexcept
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h:151:5: note: previous definition is here
bad_cast() noexcept
^
C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:17:12C:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:26:11: : warning: error: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]redefinition of
'~exception'bad_cast::~bad_cast() noexcept
exception::~exception() noexcept
^
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h:146:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h7: C:\Zig\lib\libcxxabi\src/stdlib_new_delete.cpp:34:36: :88:13: error: note: previous declaration is hereno member named 'get_new_handler' in namespace 'std'
class bad_cast
std::new_handler nh = std::get_new_handler();note:
^
previous definition is hereC:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:26:11:
~~~~~^
virtual ~exception() noexcept
PS C:\Temp\Test> error: ^
definition of implicitly declared destructorC:\Zig\lib\libcxxabi\src/stdlib_new_delete.cppC:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:21:24: :154:36:
warning: bad_cast::~bad_cast() noexcept
error: In file included from C:\Zig\lib\libcxxabi\src/cxa_handlers.cpp:19:
In file included from C:\Zig\lib\libcxxabi\src/private_typeinfo.h ^
exception:14:
no specification in declaration does not match previous declaration [-Wmicrosoft-exception-spec]In file included from C:\Zig\lib\libcxx\include/typeinfo:73:
member named 'get_new_handler' in namespace 'std'C:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:31:11:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h
std::new_handler nh = std::get_new_handler();:error: const char* exception::what() const noexcept
137:13
out-of-line definition of 'what' does not match any declaration in ~~~~~^
: ^
'std::bad_cast'error:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.hbad_cast::what() const noexcept
:target293:36: ^~~~ error
sofnote: generated.
using declaration conflictspreviousC:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp with declaration already: in scopedeclaration is here
38
using ::type_info;:13: _NODISCARD virtual char const* what() const
^
^
error: C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:21:24: redefinition of 'bad_typeid'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h:73:7:
error: bad_typeid::bad_typeid() noexcept
note: ^
targetredefinition ofof 'what'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h using declaration
:174:5: const char* exception::what() const noexcept
class type_info
^
note: ^
previous definition is hereC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h:93:36:
C:\Zig\lib\libcxxabi\include/cxxabi.h bad_typeid() noexcept
:30:27: ^
note: note: previous definition is hereconflicting declaration
C:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:42:13:
_NODISCARD virtual char const* what() constclass _LIBCXXABI_TYPE_VIS type_info; // forward declaration
warning: ^
^
function previously declared with anC:\Zig\lib\libcxxabi\src/stdlib_exception.cppIn file included from C:\Zig\lib\libcxxabi\src/cxa_handlers.cpp:19:
implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]C:\Zig\lib\libcxxabi\src/private_typeinfo.h:19:53: :28:16: error:
bad_typeid::~bad_typeid() noexcept
warning: base class ^
function previously declared C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h:with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]has169 incomplete
:7bad_exception::~bad_exception() noexcepttype:
class _LIBCXXABI_TYPE_VIS __shim_type_info : public std::type_info {
^
note: ~~~~~~~^~~~~~~~~~~~~~
previous declaration is hereC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h:103:7:
C:\Zig\lib\libcxxabi\include/cxxabi.hclass bad_typeid
:30:27: ^
note: note: previous declaration is hereC:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:42:13:
forward declaration of 'std::type_info'class bad_exception
error:
^
class _LIBCXXABI_TYPE_VIS type_info; // forward declaration
definition of ^C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:28:16: implicitly declared destructor
error:
bad_typeid::~bad_typeid() noexcept
definition of implicitly declared destructor ^
bad_exception::~bad_exception() noexcept
C:\Zig\lib\libcxxabi\src/stdlib_typeinfo.cpp:47 ^
:13: C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:32:error: 28: out-of-line definition of 'what' does not match any declaration in 'std::bad_typeid'error:
bad_typeid::what() const noexcept
out-of-line definition of 'what' does not match any declaration in 'std::bad_exception' ^~~~
const char* bad_exception::what() const noexcept
2 warnings and 7 errors generated.
^~~~
C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:40:12: error: redefinition of 'bad_alloc'
bad_alloc::bad_alloc() noexcept
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h:119:5: note: previous definition is here
bad_alloc() noexcept
^
C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:44:12: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
bad_alloc::~bad_alloc() noexcept
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h:114:7: note: previous declaration is here
class bad_alloc
^
C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:44:12: error: definition of implicitly declared destructor
bad_alloc::~bad_alloc() noexcept
^
C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:49:12: error: out-of-line definition of 'what' does not match any declaration in 'std::bad_alloc'
bad_alloc::what() const noexcept
^~~~
In file included from C:\Zig\lib\libcxxabi\src/cxa_exception.cpp:20:
In file included from C:\Zig\lib\libcxxabi\src/stdlib_exception.cppC:\Zig\lib\libcxx\src/include/atomic_support.h:13:
In file included from :C:\Zig\lib\libcxx\include/memory:898:
56:23: In file included from C:\Zig\lib\libcxx\include/__memory/shared_ptr.h:40:
In file included from error: C:\Zig\lib\libcxx\include/typeinfo:In file included from C:\Zig\lib\libcxxabi\src/cxa_guard.cpp:15:
In file included from redefinition of 'bad_array_new_length'73:
C:\Zig\lib\libcxxabi\src/cxa_guard_impl.h:48:
In file included from bad_array_new_length::bad_array_new_length() noexcept
C:\Zig\lib\libcxx\src/include/atomic_support.hC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h ^
:13:
:137:13: In file included from C:\Zig\lib\libcxx\include/memory:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h:error: 898:
In file included from C:\Zig\lib\libcxx\include/__memory/shared_ptr.h:40:
In file included from C:\Zig\lib\libcxx\include/typeinfo:73:
target139 of using declaration conflicts with declaration already in scope:5: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h
:137:13: note: using ::type_info;
previouserror: definition is heretarget
of using declaration conflicts with declaration bad_array_new_length() noexcept
^
already in scope ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h
:73:7: using ::type_info;C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:56:23: note:
target ^
of using declarationerror: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_typeinfo.h
:73:7: class type_info
constructor for 'std::bad_array_new_length' must explicitly initialize the base class 'bad_alloc' which does not have a default constructornote:
^
bad_array_new_length::bad_array_new_length() noexcepttarget of using declarationC:\Zig\lib\libcxxabi\include/cxxabi.h
:30:27: ^
class type_info
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h:114:7: note: ^
note: conflicting declaration'std::bad_alloc' declared here
C:\Zig\lib\libcxxabi\include/cxxabi.h
class _LIBCXXABI_TYPE_VIS type_info; // forward declaration
class bad_alloc
:30:27: ^
^
note: conflicting declarationC:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:60:23:
class _LIBCXXABI_TYPE_VIS type_info; // forward declaration
warning: ^
function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
bad_array_new_length::~bad_array_new_length() noexcept
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include/vcruntime_exception.h:134:7: note: previous declaration is here
class bad_array_new_length
^
C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:60:23: error: definition of implicitly declared destructor
bad_array_new_length::~bad_array_new_length() noexcept
^
C:\Zig\lib\libcxxabi\src/stdlib_exception.cpp:65:23: error: out-of-line definition of 'what' does not match any declaration in 'std::bad_array_new_length'
bad_array_new_length::what() const noexcept
^~~~
4 warnings and 11 errors generated.
In file included from C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:15:
C:\Zig\lib\libcxx\src/include/refstring.h:83:1: error: use of undeclared identifier '__libcpp_refstring'
__libcpp_refstring::__libcpp_refstring(const char* msg) {
^
C:\Zig\lib\libcxx\src/include/refstring.h:95:1: error: use of undeclared identifier '__libcpp_refstring'
__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) noexcept
^
C:\Zig\lib\libcxx\src/include/refstring.h:95:46: error: unknown type name '__libcpp_refstring'
__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) noexcept
^
C:\Zig\lib\libcxx\src/include/refstring.h:103:1: error: unknown type name '__libcpp_refstring'
__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) noexcept {
^
C:\Zig\lib\libcxx\src/include/refstring.h:103:21: error: use of undeclared identifier '__libcpp_refstring'
__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) noexcept {
^
C:\Zig\lib\libcxx\src/include/refstring.h:103:51: error: unknown type name '__libcpp_refstring'
__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) noexcept {
^
C:\Zig\lib\libcxx\src/include/refstring.h:120:1: error: use of undeclared identifier '__libcpp_refstring'
__libcpp_refstring::~__libcpp_refstring() {
^
C:\Zig\lib\libcxx\src/include/refstring.h:130:6: error: use of undeclared identifier '__libcpp_refstring'
bool __libcpp_refstring::__uses_refcount() const {
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:17:27: error: no member named '__libcpp_refstring' in namespace 'std'
static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
~~~~~^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:22:14: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
logic_error::~logic_error() noexcept {}
^
C:\Zig\lib\libcxx\include/stdexcept:77:29: note: previous declaration is here
class _LIBCPP_EXCEPTION_ABI logic_error
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:22:14: error: definition of implicitly declared destructor
logic_error::~logic_error() noexcept {}
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:25:14: error: out-of-line definition of 'what' does not match any declaration in 'std::logic_error'
logic_error::what() const noexcept
^~~~
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:27:12: error: use of undeclared identifier '__imp_'
return __imp_.c_str();
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:30:16: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
runtime_error::~runtime_error() noexcept {}
^
C:\Zig\lib\libcxx\include/stdexcept:100:29: note: previous declaration is here
class _LIBCPP_EXCEPTION_ABI runtime_error
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:30:16: error: definition of implicitly declared destructor
runtime_error::~runtime_error() noexcept {}
1 error generated.
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:33:16: error: out-of-line definition of 'what' does not match any declaration in 'std::runtime_error'
runtime_error::what() const noexcept
^~~~
1 error generated.
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:352 error:12: s generated.
error: use of undeclared identifier '__imp_'
return __imp_.c_str();
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:38:15: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
domain_error::~domain_error() noexcept {}
^
C:\Zig\lib\libcxx\include/stdexcept:123:29: note: previous declaration is here
class _LIBCPP_EXCEPTION_ABI domain_error
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:38:15: error: definition of implicitly declared destructor
domain_error::~domain_error() noexcept {}
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:39:19: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
invalid_argument::~invalid_argument() noexcept {}
^
C:\Zig\lib\libcxx\include/stdexcept:136:29: note: previous declaration is here
class _LIBCPP_EXCEPTION_ABI invalid_argument
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:39:19: error: definition of implicitly declared destructor
invalid_argument::~invalid_argument() noexcept {}
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:40:15: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
length_error::~length_error() noexcept {}
^
C:\Zig\lib\libcxx\include/stdexcept:149:29: note: previous declaration is here
class _LIBCPP_EXCEPTION_ABI length_error
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:40:15: error: definition of implicitly declared destructor
length_error::~length_error() noexcept {}
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:41:15: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
out_of_range::~out_of_range() noexcept {}
^
C:\Zig\lib\libcxx\include/stdexcept:161:29: note: previous declaration is here
class _LIBCPP_EXCEPTION_ABI out_of_range
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:41:15: error: definition of implicitly declared destructor
out_of_range::~out_of_range() noexcept {}
^
C:\Zig\lib\libcxxabi\src/stdlib_stdexcept.cpp:43:14: warning: function previously declared with an implicit exception specification redeclared with an explicit exception specification [-Wimplicit-exception-spec-mismatch]
range_error::~range_error() noexcept {}
^
C:\Zig\lib\libcxx\include/stdexcept:174:29: note: previous declaration is here
class _LIBCPP_EXCEPTION_ABI range_error
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
7 warnings and 20 errors generated.
```
### 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.
but it didn’t worked even with mingw that comes with zig.
1 Like
Fixed by compile using msys2 clang64