-
Notifications
You must be signed in to change notification settings - Fork 459
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
Command Line error D8003: Name of source file not found. Win11 with MSVC #1331
Comments
I suspect this is because the name of source file is treated as an option instead, and using cc @ChrisDenton
You can set environment variables |
The trouble, I think, is the
Basically any argument after |
Thanks, if I have time during x-mas I will open a PR. |
cc is probably treating it like a normal flag and so screws up the command string, is there a way to tell cc that a flag is a linker flag? |
i removed /link and /nostdlib and now get >100 Errors: the error looks like when i passed gcc/clang flags to msvc and it broke, but this time i thought i added the correct flags PS C:\Users\juven\SynologyDrive\uacpi-rs> cargo build Caused by: --- stderr error occurred in cc-rs: Command "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src/include" "-W4" "/kernel" "/GS-" "-DUACPI_SIZED_FREES=1" "-FoC:\Users\juven\SynologyDrive\uacpi-rs\target\debug\build\uacpi-sys-c470192487fe58d6\out\9b5d1a837e7b6553-default_handlers.o" "-c" "C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src/source/default_handlers.c" with args cl.exe did not execute successfully (status code exit code: 2). |
A workaround would be to use the I think a proper fix would probably be for |
what environment variable do i need to set to a different c compiler so that cc will use that? |
This (https://github.com/Shinribo/uacpi-rs/blob/1.0-dev/uacpi-sys/build.rs) doesnt build when cc uses msvc. It says "Command Line error D8003: Name of source file not found", it previously worked with clang. Where is the error in this code? Alternatively is there a way to tell cc not to use msvc and use clang installed via visual studio?
Full Error:
Compiling uacpi-sys v0.1.0 (C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys)
The following warnings were emitted during compilation:
warning: [email protected]: cl : Befehlszeile error D8003 : Name der Quelldatei fehlt.
error: failed to run custom build command for
uacpi-sys v0.1.0 (C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys)
Caused by:
process didn't exit successfully:
C:\Users\juven\SynologyDrive\uacpi-rs\target\debug\build\uacpi-sys-3a4a3ebc7196d5ac\build-script-build
(exit code: 1)--- stdout
OPT_LEVEL = Some(0)
OUT_DIR = Some(C:\Users\juven\SynologyDrive\uacpi-rs\target\debug\build\uacpi-sys-c470192487fe58d6\out)
TARGET = Some(x86_64-pc-windows-msvc)
cargo:rerun-if-env-changed=VCINSTALLDIR
VCINSTALLDIR = None
cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath
VSTEL_MSBuildProjectFullPath = None
cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE
VSCMD_ARG_VCVARS_SPECTRE = None
cargo:rerun-if-env-changed=WindowsSdkDir
WindowsSdkDir = None
cargo:rerun-if-env-changed=WindowsSDKVersion
WindowsSDKVersion = None
cargo:rerun-if-env-changed=LIB
LIB = None
PATH = Some(C:\Users\juven\SynologyDrive\uacpi-rs\target\debug\deps;C:\Users\juven\SynologyDrive\uacpi-rs\target\debug;C:\Users\juven.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Git\cmd;C:\Users\juven.cargo\bin;C:\Users\juven\AppData\Local\Microsoft\WindowsApps;C:\Users\juven\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\juven\AppData\Local\GitHubDesktop\bin)
cargo:rerun-if-env-changed=INCLUDE
INCLUDE = None
HOST = Some(x86_64-pc-windows-msvc)
cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
CC_x86_64-pc-windows-msvc = None
cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
CC_x86_64_pc_windows_msvc = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None
cargo:rerun-if-env-changed=CC
CC = None
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some(cmpxchg16b,fxsr,sse,sse2,sse3)
DEBUG = Some(true)
cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
CFLAGS_x86_64-pc-windows-msvc = None
cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
CFLAGS_x86_64_pc_windows_msvc = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:warning=cl : Befehlszeile error D8003 : Name der Quelldatei fehlt.
--- stderr
error occurred in cc-rs: Command "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src/include" "-W4" "/kernel" "/GS-" "/link" "/NODEFAULTLIB" "-DUACPI_SIZED_FREES=1" "-FoC:\Users\juven\SynologyDrive\uacpi-rs\target\debug\build\uacpi-sys-c470192487fe58d6\out\9b5d1a837e7b6553-default_handlers.o" "-c" "C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src/source/default_handlers.c" with args cl.exe did not execute successfully (status code exit code: 2).
The text was updated successfully, but these errors were encountered: