-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support -lc++ on windows for the msvc ABI #5312
Comments
The issue appears to be that we try to compile libcxxabi when using the MSVC c++ stdlib, I assume this is just wrong. |
I don't think this is still an issue. @SpexGuy would you mind double checking that the error is now a linking error stating the lack of |
This doesn't seem to be fixed, but some things have rearranged. Since we changed to the mingw abi by default, you need to use this command now to reproduce: We compile libc files in parallel now, so the error message is considerably harder to read as errors from many files are interleaved. I've attached the result of running this command: |
OK, some success in at least narrowing this down. As far as I understood from LLVM's docs, they "guarantee" (or claim) that it is possible to build As far as I understood, namespace std {
class type_info;
} while being declared into the namespace std {
using ::type_info;
} where it is also defined in the global scope. FWIW this actually should build fine with GCC, however, clang complains with an error
This can be fixed with the following diff to the diff --git a/lib/libcxxabi/include/cxxabi.h b/lib/libcxxabi/include/cxxabi.h
index 43ce6f5f7..c51579d77 100644
--- a/lib/libcxxabi/include/cxxabi.h
+++ b/lib/libcxxabi/include/cxxabi.h
@@ -25,12 +25,14 @@
#ifdef __cplusplus
-namespace std {
#if defined(_WIN32)
class _LIBCXXABI_TYPE_VIS type_info; // forward declaration
#else
class type_info; // forward declaration
#endif
+
+namespace std {
+ using ::type_info;
} However, then we still hit a far more critical error
As you will know, |
I just want to say even if you get past the missing unistd header you will then need to empty alot of of the cpp files because of re-declaration errors. |
Dang, I am also stuck here. Seeing issues with exceptions and type_info as above when targeting msvc from ubuntu on 10.0-dev.3475, but compiles fine with gnu. |
Not sure if this is useful, but I've had success with passing cpp files to |
On Windows,
zig c++ empty_file.cpp
fails with this error:The same error is observed when building
pub fn main() void {}
withzig build-exe -lc++
.Adding
--target=native-native-gnu
seems to fix it.The text was updated successfully, but these errors were encountered: