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

Fails to cross-compile from linux to pc-windows-gnu #302

Closed
dtolnay opened this issue Sep 16, 2020 · 0 comments · Fixed by #303
Closed

Fails to cross-compile from linux to pc-windows-gnu #302

dtolnay opened this issue Sep 16, 2020 · 0 comments · Fixed by #303
Labels
bug windows Issues that manifest on Windows

Comments

@dtolnay
Copy link
Owner

dtolnay commented Sep 16, 2020

Official Windows documentation refers to it variously as Basetsd.h (https://docs.microsoft.com/en-us/windows/win32/winprog64/the-tools#include-files) and BaseTsd.h (https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types) but it appears the actual file they ship is basetsd.h. As reported by jebrosen in discord:

the file is actually at Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/shared/basetsd.h (lowercase) on my windows install. And of course windows being case-insensitive you probably wouldn't ever notice this except in cross-compilation

When cross compiling or compiling from a case sensitive filesystem, it fails to find out current import of BaseTsd.h added in #97.

The following warnings were emitted during compilation:

warning: In file included from src/cxx.cc:1:
warning: src/../include/cxx.h:14:10: fatal error: 'BaseTsd.h' file not found
warning: #include <BaseTsd.h>
warning:          ^~~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `cxx v0.4.4 (/git/cxx)`

Caused by:
  process didn't exit successfully: `/git/cxx/target/debug/build/cxx-d96d8bbe071f88b7/build-script-build` (exit code: 1)
  --- stdout
  TARGET = Some("x86_64-pc-windows-gnu")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-unknown-linux-gnu")
  CXX_x86_64-pc-windows-gnu = None
  CXX_x86_64_pc_windows_gnu = None
  TARGET_CXX = None
  CXX = Some("clang  ")
  CXXFLAGS_x86_64-pc-windows-gnu = None
  CXXFLAGS_x86_64_pc_windows_gnu = None
  TARGET_CXXFLAGS = None
  CXXFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CXX_x86_64-pc-windows-gnu = None
  CXX_x86_64_pc_windows_gnu = None
  TARGET_CXX = None
  CXX = Some("clang  ")
  CXXFLAGS_x86_64-pc-windows-gnu = None
  CXXFLAGS_x86_64_pc_windows_gnu = None
  TARGET_CXXFLAGS = None
  CXXFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  running: "clang  " "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "--target=x86_64-pc-windows-gnu" "-Wall" "-Wextra" "-std=c  11" "-o" "/git/cxx/target/x86_64-pc-windows-gnu/debug/build/cxx-e9cfa76dc60ab8d1/out/src/cxx.o" "-c" "src/cxx.cc"
  cargo:warning=In file included from src/cxx.cc:1:
  cargo:warning=src/../include/cxx.h:14:10: fatal error: 'BaseTsd.h' file not found
  cargo:warning=#include <BaseTsd.h>
  cargo:warning=         ^~~~~~~~~~~
  cargo:warning=1 error generated.
  exit code: 1

  --- stderr


  error occurred: Command "clang  " "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "--target=x86_64-pc-windows-gnu" "-Wall" "-Wextra" "-std=c  11" "-o" "/git/cxx/target/x86_64-pc-windows-gnu/debug/build/cxx-e9cfa76dc60ab8d1/out/src/cxx.o" "-c" "src/cxx.cc" with args "clang  " did not execute successfully (status code exit code: 1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug windows Issues that manifest on Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant