-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Building tetris on Windows -> zig-cache\build crashes #576
Comments
zig-cache\build
crashes
Alright, I got a bit further by not using the build.zig. Now it complains
If I look at
And defines do work for GLFW:
Any idea why it doesn't pick up the defines from epoxy? |
It doesn't pick up printf from stdio.h either. |
Note that I haven't yet gotten tetris building natively on windows. These error reports are helpful though.
This is #516 which will be fixed with the next LLVM release.
This can be fixed with the workaround in example/hello_world/hello_libc.zig: when our c-to-zig translation powers improve this workaround can be removed. |
Re #516: Does that mean that you link the Anything I can do for gl.h? I'll try the workaround for printf later, thanks! |
You can - I tested this and it works - but you're going into unsupported-land so you'll have to maintain your own fork that does this. (I'm happy to provide guidance, just not going to merge the code into zig repo). You'll want to change the call from
Workaround: |
Thank you for the pointers. I downloaded epoxy from here: https://github.com/anholt/libepoxy/releases The code is very basic, which is why I found it surprising that it would get all the GLFW macros, but not the GL ones.
|
http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html I liked this quote:
|
It should for sure understand these macros, which makes me think that somehow the C files didn't end up including that code. On linux the build is working, and it's correctly translating those macros. So something else is going wrong. |
The
|
Please let me know if you need anything in order to reproduce this. |
main.zig:
c.zig:
glfw/gltest.h:
build.bat:
build.txt:
|
awesome example @haferburg, I'm going to look into this today. |
This a line ending issue. While Zig may detect '\r' in its own code, it does not detect it in c_imports. You should be able to get it work by setting your line endings to unix in your text editor. |
@dimenus Thank you very much! It does work indeed with unix line endings. Now the only thing missing is libpng, which I'll try to build tomorrow. Thanks everyone! :) |
Just a note: we will support windows line endings in C imports. I'll do that before closing this issue. |
Ah nice thanks both of you for submitting pull requests |
So after resolving the line ending issue, I got it to compile, but the compiler crashed, without any error message. I built LLVM, Clang, and zig in Debug mode, and got the following stack trace. Unfortunately the Clang and LLVM people don't install .pdb files with the INSTALL scripts. I don't know if this is helpful.
|
@haferburg did you compile master llvm or release_50? |
@dimenus release_50 The LLVMConfig.cmake says:
|
Can this issue be closed now? |
I can't debug the
zig-cache\build
file, because there is no source attached. Is there any way for me to tell zig to embed source debugging info?The text was updated successfully, but these errors were encountered: