-
Notifications
You must be signed in to change notification settings - Fork 64
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
Error compiling with Ninja on Windows #41
Comments
Build systems are always "fun" stuff... I'm not exactly sure about the reasons causing this. But it seems you are compiling SPIRV-Cross together with Shaderc? The error messages seem to indicate they have conflicting symbols:
It's likely because they are linking against different flavors of C runtime library: |
Hey @ocboogie, is this still an issue for you? I'd like to close this if not. |
I just tried it again after recently formatting my computer, with a fresh install of Python, CMake, Visual C++ Build Tools and Ninja. This is what I got sadly:
The work around I've been using is to compile the shaders in the build.rs file. This error only happens with specific dependencies. |
Yeah, when I run: use shaderc;
fn main() {
let source = "#version 310 es\n void EP() {}";
let mut compiler = shaderc::Compiler::new().unwrap();
let mut options = shaderc::CompileOptions::new().unwrap();
options.add_macro_definition("EP", Some("main"));
let binary_result = compiler.compile_into_spirv(
source, shaderc::ShaderKind::Vertex,
"shader.glsl", "main", Some(&options)).unwrap();
assert_eq!(Some(&0x07230203), binary_result.as_binary().first());
} it works fine, but the following doesn't work: use shaderc;
use gfx_backend_dx12 as back;
fn main() {
let source = "#version 310 es\n void EP() {}";
let mut compiler = shaderc::Compiler::new().unwrap();
let mut options = shaderc::CompileOptions::new().unwrap();
options.add_macro_definition("EP", Some("main"));
let binary_result = compiler.compile_into_spirv(
source, shaderc::ShaderKind::Vertex,
"shader.glsl", "main", Some(&options)).unwrap();
assert_eq!(Some(&0x07230203), binary_result.as_binary().first());
} This is what I get
I've tried the |
I got this error today. |
Fix incoming |
Thanks @omni-viral for PR #57! I'll close this one. Please re-open if the error persists. |
I get a linking error when trying to compile with Ninja:
Versions:
It's building fine without Ninja, but I had to target somewhere else, so I tried using Ninja as described in the README.
I tried reinstalling CMake, Python, Ninja, and even Build Tools.
To be honest I'm not quite sure if this is even an issue with shaderc-rs.
Update: I was using the triangle example from learn-gfx-hal when getting this error, changing it to the example given in the README works. I'll try to figure out what exactly is causing this.
The text was updated successfully, but these errors were encountered: