Closed mitchmindtree closed 6 years ago
Seems like this might be relevant https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2017
Kind of related https://github.com/rust-lang-nursery/rust-bindgen/issues/1226
Ahhh hold up, I DLd clang 7 but it looks like rust-bindgen uses 6 https://github.com/rust-lang-nursery/rust-bindgen/blob/master/Cargo.toml Tom do you remember needing a specific version of clang?
Could be worth double checking these vars too https://github.com/KyleMayes/clang-sys/blob/master/README.md#environment-variables
Tom do you remember needing a specific version of clang?
No I used clang 7 and it worked. I'm pretty sure clang is backwards compatible
This might be relevant even if it is out of date.
I have used this same setup on 3 different machines and it's worked. I'm wondering if there was maybe some option needed when installing visual studio c++ tools. Also I selected include LLVM in all users PATH. Not sure if that is relevant.
It looks like LLVM is already in my path:
PS C:\Users\mindtree\programming\rust\cpal> $env:PATH
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Users\mindtree\.cargo\bin;C:\Users\mindtree\AppData\Local\Microsoft\WindowsApps;C:\Program Files\LLVM\bin
I can confirm that it's visible in the current powershell command line environment by running clang --help
.
I'll keep looking into this once I get passed #14.
Can you compile a super simple hello_world.cpp with clang?
Agh no I can't actually:
PS C:\Users\mindtree> clang .\hello_world.cpp -o hello_world
clang.exe: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
.\hello_world.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 error generated.
I'll read over the posts more closely.
Can you try that from one of the developer command prompt. I think it's the "native" one that works for me
On Sun., 14 Oct. 2018, 9:16 pm mitchmindtree, notifications@github.com wrote:
I'll read over the posts more closely.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/freesig/cpal/issues/7#issuecomment-429612726, or mute the thread https://github.com/notifications/unsubscribe-auth/AG8utlA13wn_jX5EO2qAT_P6Vl4TnBf9ks5ukw8YgaJpZM4XZXUR .
Do you mean try it with the regular windows cmd
prompt rather than powershell? Just tried and I et the exact same error.
I'm going to try and install the visual c++ build tools again - they were installed on this so long ago that I don't remember what that setup was like.
Alright, up to a new error!
Compiling asio-sys v0.1.0 (file:///C:/Users/mindtree/programming/rust/cpal/asio-sys)
error: failed to run custom build command for `asio-sys v0.1.0 (file:///C:/Users/mindtree/programming/rust/cpal/asio-sys)`
process didn't exit successfully: `C:\Users\mindtree\programming\rust\cpal\asio-sys\target\debug\build\asio-sys-422339b3d3fcf882\build-script-build` (exit code: 101)
--- stdout
error: IO error for operation on C:\Users\mindtree\.asio\ASIOSDK2.3.1\host: The system cannot find the path specified. (os error 3)
error: IO error for operation on C:\Users\mindtree\.asio\ASIOSDK2.3.1\host/pc: The system cannot find the path specified. (os error 3)
error: IO error for operation on C:\Users\mindtree\.asio\ASIOSDK2.3.1\common: The system cannot find the path specified. (os error 3)
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-msvc")
CXX_x86_64-pc-windows-msvc = None
CXX_x86_64_pc_windows_msvc = None
HOST_CXX = None
CXX = None
CXXFLAGS_x86_64-pc-windows-msvc = None
CXXFLAGS_x86_64_pc_windows_msvc = None
HOST_CXXFLAGS = None
CXXFLAGS = None
DEBUG = Some("true")
running: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe" "/nologo" "/MD" "/Z7" "/I" "C:\\Users\\mindtree\\.asio\\ASIOSDK2.3.1/host" "/I" "C:\\Users\\mindtree\\.asio\\ASIOSDK2.3.1/common" "/I" "C:\\Users\\mindtree\\.asio\\ASIOSDK2.3.1/host/pc" "/I" "asio-link/helpers.hpp" "/W4" "/FoC:\\Users\\mindtree\\programming\\rust\\cpal\\asio-sys\\target\\debug\\build\\asio-sys-a327ee4db8fa5590\\out\\asio-link\\helpers.o" "/c" "asio-link/helpers.cpp"
helpers.cpp
c:\users\mindtree\programming\rust\cpal\asio-sys\asio-link\helpers.hpp(2): fatal error C1083: Cannot open include file: 'asiodrivers.h': No such file or directory
exit code: 2
--- stderr
thread 'main' panicked at '
Internal error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe" "/nologo" "/MD" "/Z7" "/I" "C:\\Users\\mindtree\\.asio\\ASIOSDK2.3.1/host" "/I" "C:\\Users\\mindtree\\.asio\\ASIOSDK2.3.1/common" "/I" "C:\\Users\\mindtree\\.asio\\ASIOSDK2.3.1/host/pc" "/I" "asio-link/helpers.hpp" "/W4" "/FoC:\\Users\\mindtree\\programming\\rust\\cpal\\asio-sys\\target\\debug\\build\\asio-sys-a327ee4db8fa5590\\out\\asio-link\\helpers.o" "/c" "asio-link/helpers.cpp" with args "cl.exe" did not execute successfully (status code exit code: 2).
', C:\Users\mindtree\.cargo\registry\src\github.com-1ecc6299db9ec823\cc-1.0.25\src\lib.rs:2260:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
OK so back to the original windows.h error!
The windows.h error is fixed by using a specific command prompt, in my case:
Select Visual C== 2015 x64 Native Build Tools Command Prompt
which can be found via the start menu.
@freesig says this runs a .bat
file that sets a bunch of environment variables.