java - 使用 LLVM 运行 javacpp 预设时出现 UnsatisfiedLinkError

标签 java c++ llvm javacpp

我正在尝试为 LLVM 使用 javacpp-presets,但似乎存在链接时间问题:每当我尝试运行我的程序时,我都会收到错误

"Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniLLVM in java.library.path" I'm on a Windows 10 machine.

下面是我的代码

package baecompiler;
//boilerplate code https://github.com/bytedeco/javacpp-presets/tree/master/llvm
//so we can play with LLVM code generation
// General stuff
import org.bytedeco.javacpp.*;

// Headers required by LLVM
import static org.bytedeco.javacpp.LLVM.*;

public class LLVMExperiment {

    public static void main (String[] args) {

        BytePointer error = new BytePointer((Pointer)null); // Used to retrieve messages from functions

        LLVMLinkInMCJIT(); //the line it fails on

        ....

最佳答案

将 -Djava.library.path=x 添加到命令行,其中 x 是 jniLLVM.dll 文件的完整路径。

关于java - 使用 LLVM 运行 javacpp 预设时出现 UnsatisfiedLinkError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55348342/

相关文章:

c - 使用 emscripten 找不到 Windows.h

linux - 安装安装

java - 在 eclipse 中将所有来自 java 包的标记为 @Depracated

java - 为什么在 Java 字节码中跳转而不是返回?

java - Android SeekBar 抖动

C++ 在同一类的方法之间共享对象的首选方式

c++ - 在特定的 Windows DLL 模块中分配内存

c++ - "Builder"函数模板

unit-testing - 一个单元在哪个级别测试无锁代码?

java - 如何将 Java 类与 Python 集成?