Skip to content
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

cxx bridge error: Failed to copy cxx.h on Windows #1252

Closed
BeastLe9enD opened this issue Aug 6, 2023 · 2 comments · Fixed by #1253
Closed

cxx bridge error: Failed to copy cxx.h on Windows #1252

BeastLe9enD opened this issue Aug 6, 2023 · 2 comments · Fixed by #1253

Comments

@BeastLe9enD
Copy link

Hey, I have problems with cxx on Windows, when compiling the crate the following error occurs:
I tested on 3 systems, on two it fails and on one windows system it compiles without problems. Any ideas whats the problem here?

https://github.com/ProjectKML/gdeflate-rs/ this is the crate that's using cxx.

fn main() {
    cxx_build::bridge("src/lib.rs")
        .include("src")
        .file("src/GDeflateCompress.cpp")
        .file("src/GDeflateDecompress.cpp")
        .include("vendor/libdeflate")
        .file("vendor/libdeflate/lib/gdeflate_compress.c")
        .file("vendor/libdeflate/lib/gdeflate_decompress.c")
        .file("vendor/libdeflate/lib/utils.c")
        .compile("gdeflate_cxx");
}
error: failed to run custom build command for `gdeflate v0.1.2 (C:\Users\cach30verfl0w\Desktop\gdeflate-rs)`

Caused by:
  process didn't exit successfully: `C:\Users\cach30verfl0w\Desktop\gdeflate-rs\target\debug\build\gdeflate-8b612263636dfc2b\build-script-build` (exit code: 1)
  --- stderr


  cxxbridge error: Failed to copy `..\..\..\..\..\..\..\..\..\..\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cxx-1.0.103\include\cxx.h` -> `C:\Users\cach30verfl0w\Desktop\gdeflate-rs\target\debug\build\gdeflate-72183011123d6af9\out\cxxbridge\include\rust\cxx.h`

  Caused by:
      The system cannot find the path specified. (os error 3)


warning: build failed, waiting for other jobs to finish...
@dtolnay
Copy link
Owner

dtolnay commented Aug 6, 2023

I think I know the issue. Could you try with cxx-build 1.0.104, and see whether that has fixed this?

@dtolnay dtolnay changed the title cxx brodge error: Failed to copy cxx.h on Windows cxx bridge error: Failed to copy cxx.h on Windows Aug 6, 2023
@BeastLe9enD
Copy link
Author

It works now, thanks a lot for the fast response and help :)

@dtolnay dtolnay linked a pull request Aug 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants