Git Product home page Git Product logo

Comments (6)

nlordell avatar nlordell commented on April 28, 2024 2

Using the mingw-builds toolchain v6.3.0 mostly works. cargo test successfully runs all tests but fails to compile doc-tests. I think this is linked to rust-lang/rust#41607. From what I gather doc-tests link differently than regular tests and executables. It also seems to affect proc-macro linking.

Additionally linking to:

    println!("cargo:rustc-link-lib=dylib=pthread");
    println!("cargo:rustc-link-lib=dylib=gcc_eh");
    println!("cargo:rustc-link-lib=dylib=msvcrt");

Seems to fix the problem, but I must admit I don't 100% understand what is going on. With this, cargo test seems to pass.

from shaderc-rs.

antiagainst avatar antiagainst commented on April 28, 2024

Yep, for macOS, I think you typically use Homebrew.

I'm not quite familiar with MinGW development. Is it a requirement to have both MSVC and GNU toolchain working for Vulkano?

from shaderc-rs.

rukai avatar rukai commented on April 28, 2024

Yes, it is a requirement, mostly for selfish reasons. My project requires windows-gnu because libusb only builds there. https://github.com/rukai/PF_Sandbox Of course, the other alternative for me is to get libusb to build on windows-msvc.

I figured you might have a better idea of whats needed to get shaderc building on windows-gnu as I have little experience with C++. However looks like I'll have to dig in and get some experience.

from shaderc-rs.

nlordell avatar nlordell commented on April 28, 2024

It's a linking issue. Looks like the build script is not linking against stdc++ when targeting windows-gnu. Doing something like this in build.rs gets rid of a lot of errors:

    match (target_os.as_str(), target_env.as_str()) {
        ("linux", _) | ("windows", "gnu") => println!("cargo:rustc-link-lib=dylib=stdc++"),
        ("macos", _) => println!("cargo:rustc-link-lib=dylib=c++"),
        _ => {}
    }

However the link step is still failing complaining about undefined reference to `__imp___acrt_iob_func'. I will keep on investigating

from shaderc-rs.

nlordell avatar nlordell commented on April 28, 2024

Looks like the undefined reference to `__imp___acrt_iob_func' errors are a symptom of a larger problem. Take a look at rust-lang/rust#47048 for a longer discussion.

From what I understood it looks like MSYS2 with the latest MinGW-w64 toolchain does not currently work with Rust. I am going to try with mingw-builds toolchain v6.3.0 (same one that Rust uses) and see if I get further.

from shaderc-rs.

antiagainst avatar antiagainst commented on April 28, 2024

Addressed by #28

from shaderc-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.