-
Notifications
You must be signed in to change notification settings - Fork 50
Description
With my current project I've stepped into a problem with native libraries. The issue is that lwjgl cannot find its natives although the jar with the natives is properly linked to the project and appears in Leiningen Dependencies.
I have made a little research and found out that this problem is known for lwjgl:
-
http://wiki.lwjgl.org/wiki/Downloading_and_Setting_Up_LWJGL look at the "I keep getting an java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path" paragraph
-
this is how it is solved normally in eclipse: http://stackoverflow.com/questions/19344914/getting-java-lang-unsatisfiedlinkerror-no-lwjgl-in-java-library-path
-
and the official guide: http://wiki.lwjgl.org/index.php?title=Setting_Up_LWJGL_with_Eclipse (mostly same as point 2), but with neat pictures ).
So, in my project there is the lwjgl natives jar, however, the java lwjgl jar native library path points to "project/target/native/windows/x86_64" and in the project build path setup it says "not modifiable".
The interesting part is that the natives are actually do get extracted and are there ready to be picked up, but they are located at "project/target/native/windows".
Resume: if I manually copy the dlls from "project/target/native/windows" to "project/target/native/windows/x86_64", all starts working okay. I know leiningen and java in general have their quirks in working with native libraries, but what is different in this case, is that the path "project/target/native/windows/x86_64" is incorrect and cannot be changed. Is there something in CCW that is getting in touch with this?
A small GitHub project illustrating the issue: https://github.com/noncom/test-natives
Upon loading the core ns into the repl, you'll get:
;; Clojure 1.6.0
<Namespace test-natives.core>
CompilerException java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path, compiling:(test_natives\core.clj:4:3)
and if you move the natives as I've described above, it will compile fine. even calling (go) will work ok and return nil. It does not matter that you have no actual opengl context active