-
-
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
Program built by Zig can't link correctly against system LLVM libraries in Arch Linux #19275
Comments
these seem much more relevant
I would double check that llvm is visible to your build |
As I said, using Clang works just fine:
|
no it didn't ? |
Yes, it did. It just doesn't find the |
So after trying to understand what Zig does to link against libstdc++, I came out with something that works: compiler.addObjectFile(.{ .cwd_relative = "/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/libstdc++.so" });
compiler.addIncludePath(.{ .cwd_relative = "/usr/include"});
compiler.addIncludePath(.{ .cwd_relative = "/usr/include/c++/13.2.1"});
compiler.addIncludePath(.{ .cwd_relative = "/usr/include/c++/13.2.1/x86_64-pc-linux-gnu"});
compiler.addLibraryPath(.{ .cwd_relative = "/usr/lib"}); The solution is not ideal and probably the best thing is to let the user link against libstdc++ without these workarounds, unless I am missing something? |
You can't mix different libc++ |
Zig Version
0.12.0-dev.3191+9cf28d1e9
Steps to Reproduce and Observed Behavior
Observe birth-software/nativity#112
I get these linking errors: https://zigbin.io/d2c32c
Relevant part of the build.zig code:
Am I doing anything wrong? Or is it just impossible to work with C++ system libraries from Zig. I tried with Clang and it works...
Expected Behavior
To be able to compile and link correctly.
The text was updated successfully, but these errors were encountered: