【问题标题】:UnsatisfiedLinkError when running javacpp presets with LLVM使用 LLVM 运行 javacpp 预设时出现 UnsatisfiedLinkError
【发布时间】:2019-03-26 00:46:02
【问题描述】:

我正在尝试为 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

        ....

【问题讨论】:

  • 能否提供您的 pom.xml 文件?

标签: java c++ llvm javacpp


【解决方案1】:

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

【讨论】:

  • 你知道我在哪里可以找到那个 dll 吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-04-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-02-15
  • 2017-06-09
相关资源
最近更新 更多