Integrating native system libraries with SBT

前端 未结 3 1355
囚心锁ツ
囚心锁ツ 2020-12-08 00:56

What is a good way to integrate various SBT tasks with native libraries (for example, those from JOGL, LWGL, or JCuda? Specifically,

  1. Is there a recommended

3条回答
  •  無奈伤痛
    2020-12-08 01:23

    Under Osx, if you have issues loading native libs in /lib/*.jnilib during sbt test.

    [error] java.lang.UnsatisfiedLinkError: Fatal execution error, caused by no jniortools in java.library.path

    You can use the following code instead of System.loadLibrary("jniortools").

    new File("lib").listFiles().map(_.getAbsolutePath).filter(_.endsWith("jniortools.jnilib")).foreach(System.load)
    

提交回复
热议问题