如果我使用 org.graalvm.nativeimage.c,gluonfx 的原生图像会失败

Native image with gluonfx fails if I use org.graalvm.nativeimage.c

我有一个 JavaFx 项目,我正在使用 GluonFx 将其编译为本机,没有任何问题。

我最近不得不添加一个使用 DLL 的功能,以利用其本机功能。我已经使用此解决方案通过 GraalVm 完成了此操作:https://yyhh.org/blog/2021/02/writing-c-code-in-javaclojure-graalvm-specific-programming/

现在,当我尝试使用 gluonfx:build 编译为本机时,出现以下错误:

[Project source] package org.graalvm.nativeimage.c does not exist
[Project source] package org.graalvm.nativeimage.c.function does not exist
[Project source] package org.graalvm.nativeimage.c.function does not exist
[Project source] package org.graalvm.nativeimage.c.struct does not exist
[Project source] package org.graalvm.nativeimage.c.struct does not exist
[Project source] package org.graalvm.nativeimage.c.type does not exist
[Project source] package org.graalvm.nativeimage.c.type does not exist
[Project source] package org.graalvm.nativeimage.c.type does not exist
[Project source] package org.graalvm.word does not exist
[Project source] cannot find symbol symbol: class CContext
[Project source]cannot find symbol symbol: class CLibrary
.....
.....

以前有人遇到过这个问题吗? graalvm.nativeimage.c 不应该是 graalvm sdk 的一部分吗?

提前致谢

José Pereda 在评论中回答

“您是否将所需的依赖项(如 org.graalvm.nativeimage:library-support)添加到项目中?”

添加依赖项解决了我的问题。谢谢