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

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

Open
Shinribo opened this issue Dec 23, 2024 · 7 comments
Open

Comments

@Shinribo
Copy link

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).

@NobodyXu
Copy link
Collaborator

It says "Command Line error D8003: Name of source file not found"

I suspect this is because the name of source file is treated as an option instead, and using -- to separate options and name might help?

cc @ChrisDenton

Alternatively is there a way to tell cc not to use msvc and use clang installed via visual studio?

You can set environment variables CC to use a different compiler.

@ChrisDenton
Copy link
Member

The trouble, I think, is the /link:

The /link option and its linker options must appear after any file names and CL options

Basically any argument after /link is sent to the linker not the compiler so /link /NODEFAULTLIB has to be last.

@NobodyXu
Copy link
Collaborator

Thanks, if I have time during x-mas I will open a PR.

@Shinribo
Copy link
Author

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?

@Shinribo
Copy link
Author

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
Compiling uacpi-sys v0.1.0 (C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys)
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
default_handlers.c
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/platform/types.h(55): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/platform/types.h(55): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/platform/types.h(55): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/types.h(87): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/types.h(376): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/types.h(439): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/internal/types.h(28): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/internal/types.h(165): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/internal/types.h(222): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/internal/types.h(228): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/internal/types.h(235): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/internal/types.h(236): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/internal/types.h(275): warning C4201: Nicht dem Standard entsprechende Erweiterung: Struktur/Union ohne Namen
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/utilities.h(63): warning C4200: Nicht dem Standard entsprechende Erweiterung: Null-Array in Struktur/Union
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/utilities.h(92): warning C4200: Nicht dem Standard entsprechende Erweiterung: Null-Array in Struktur/Union
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(57): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(57): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(57): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(72): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(72): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(72): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(85): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(85): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(85): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(87): warning C4200: Nicht dem Standard entsprechende Erweiterung: Null-Array in Struktur/Union
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(92): warning C4200: Nicht dem Standard entsprechende Erweiterung: Null-Array in Struktur/Union
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(142): warning C4200: Nicht dem Standard entsprechende Erweiterung: Null-Array in Struktur/Union
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(148): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(148): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(148): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(164): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(164): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(164): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(173): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(173): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(173): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(199): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(199): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(199): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(206): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(206): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(206): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(214): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(214): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(214): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(221): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(221): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(221): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(230): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(230): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(230): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(232): warning C4200: Nicht dem Standard entsprechende Erweiterung: Null-Array in Struktur/Union
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(242): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(242): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(242): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(257): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(257): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(257): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(266): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(266): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(266): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(275): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(275): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(275): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(307): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(307): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(307): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(318): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(318): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(318): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(332): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(332): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(332): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(340): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(340): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(340): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(349): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(349): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(349): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(357): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(357): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(357): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(368): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(368): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(368): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(378): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(378): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(378): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(387): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(387): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(387): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(396): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(396): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(396): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(405): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(405): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(405): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(415): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(415): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(415): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(424): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(424): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(424): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(437): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(437): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(437): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(451): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(451): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(451): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(465): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(465): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(465): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(480): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(480): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(480): error C2059: Syntaxfehler: "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(493): warning C4200: Nicht dem Standard entsprechende Erweiterung: Null-Array in Struktur/Union
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(499): error C2143: Syntaxfehler: Es fehlt ")" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(499): error C2143: Syntaxfehler: Es fehlt "{" vor "!"
C:\Users\juven\SynologyDrive\uacpi-rs\uacpi-sys\uacpi-src\include\uacpi/acpi.h(499): fatal error C1003: Mehr als 100 Fehler gefunden; Kompilierung wird abgebrochen.

--- 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).

@ChrisDenton
Copy link
Member

A workaround would be to use the _LINK_ environment variable to put /LINK /NODEFAULT into. These will be processed by the MSVC linker after other arguments. See https://learn.microsoft.com/en-us/cpp/build/reference/linking?view=msvc-170#link-environment-variables

I think a proper fix would probably be for cc to have a link_flag function for passing linker flags.

@Shinribo
Copy link
Author

what environment variable do i need to set to a different c compiler so that cc will use that?

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

No branches or pull requests

3 participants