致命错误C1034:stdio.h:未指定包含文件的搜索路径。 GraalVM Native Image 没有编译我的项目

问题描述 投票:0回答:1

GraalVM 没有编译我的项目,我尝试了这个:

PS D:\Documents\Intellij Idea Projects\Project> ./gradlew.bat nativeRun

Configure project :
Project : => 'com.user.Project' Java module

Task :nativeCompile
[native-image-plugin] GraalVM Toolchain detection is disabled
[native-image-plugin] GraalVM location read from environment variable: JAVA_HOME
[native-image-plugin] Native Image executable path: C:\Users\user.jdks\graalvm-jdk-17.0.9\bin\native-image.cmd
=======================================================================================================================
GraalVM Native Image: Generating 'Project' (executable)...
========================================================================================================================For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md

[1/8] Initializing... (0,0s @ 0,09GB)
Error: Error compiling query code (in C:\Users\user\AppData\Local\Temp\SVM-5906854269780920035\AArch64LibCHelperDirectives.c). Compiler command ''D:\Program Files\Microsoft Visual Studio\2022\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\cl.exe' /WX /W4 /wd4201 /wd4244 /wd4245 /wd4800 /wd4804 /wd4214 '/FeC:\Users\JustDeax\AppData\Local\Temp\SVM-5906854269780920035\AArch64LibCHelperDirectives.exe' 'C:\Users\user\AppData\Local\Temp\SVM-5906854269780920035\AArch64LibCHelperDirectives.c'' output included error: [AArch64LibCHelperDirectives.c, C:\Users\user\AppData\Local\Temp\SVM-5906854269780920035\AArch64LibCHelperDirectives.c(1): fatal error C1034: stdio.h: no search path for included files is specified]
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
                    1,1s (11,4% of total time) in 19 GCs | Peak RSS: 0,43GB | CPU load: 2,91
========================================================================================================================
Finished generating 'Project' in 8,4s.

Task :nativeCompile FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':nativeCompile'.
Process 'command 'C:\Users\user.jdks\graalvm-jdk-17.0.9\bin\native-image.cmd'' finished with non-zero exit value 1

Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 13s
5 actionable tasks: 1 executed, 4 up-to-date

我的带有所需组件的 Visual Studio 不在默认目录中,也许我需要在环境变量中添加一些东西

java visual-studio graalvm graalvm-native-image
1个回答
0
投票

从“本机工具命令提示符”运行 gradle 命令,这将使所有 VS 路径按顺序排列。

您可以在此处查看如何运行它

参考:

https://github.com/oracle/graal/issues/4104

© www.soinside.com 2019 - 2024. All rights reserved.