Skip to content

Command Line error D8003: Name of source file not found. Win11 with MSVC #1331

Open
@Shinribo

Description

@Shinribo

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: uacpi-sys@0.1.0: 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsWindows targets and toolchainsbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions