[SOLVED] Failed to locate library: lwjgl.dll

Started by Brouilles, January 15, 2017, 13:51:50

Previous topic - Next topic

Brouilles

Hello,
First of all,  thanks to the LWJGL teams, is to the people who actively participate in the project, you do great work!
I download the version 3.1.1 build 16, ZIP Bundle with presets "Minimal OpenGL". With Windows, macOs et Linux natives.

I use IntelliJ IDEA as IDE, I normally followed correctly the configuration of the project (surely not seen that I have error ^^),https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install#intellij-idea. I have included the natives (see pictures).




But I encounter the following error that I can not correct. I am not a professional in Java and I think the problem is all stupid. "Failed to locate library: lwjgl.dll"
[LWJGL] Version: 3.1.1 build 16
[LWJGL] 	 OS: Windows 10 v10.0
[LWJGL] 	JRE: 1.8.0_111 amd64
[LWJGL] 	JVM: Java HotSpot(TM) 64-Bit Server VM v25.111-b14 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL] 	lwjgl.dll not found in java.library.path
[LWJGL] Failed to load a library. Possible solutions:
	a) Set -Djava.library.path or -Dorg.lwjgl.librarypath to the directory that contains the shared libraries.
	b) Add the JAR(s) containing the shared libraries to the classpath.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: lwjgl.dll
	at org.lwjgl.system.Library.loadSystem(Library.java:123)
	at org.lwjgl.system.Library.<clinit>(Library.java:53)
	at org.lwjgl.system.MemoryAccessJNI.<clinit>(MemoryAccessJNI.java:13)
	at org.lwjgl.system.Pointer.<clinit>(Pointer.java:22)
	at org.lwjgl.system.Platform.mapLibraryNameBundled(Platform.java:76)
	at org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:566)
	at com.dezeiraud.engine.Display.init(Display.java:31)
	at com.dezeiraud.engine.Display.<init>(Display.java:19)
	at com.dezeiraud.engine.CoreEngine.<init>(CoreEngine.java:28)
	at com.dezeiraud.main.Main.main(Main.java:13)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

So the problem concerns a priori of the dll path, however being given that they are normally included in a jar I do not know what to do.
Thank you for taking the time to read my post, hoping you can enlighten me!

I apologize for my bad English,
Best Regards.

spasi

The lwjgl-*-natives-* jar files should be added as "Classes", not as "Native Library Locations". They must be in the classpath for LWJGL to automatically discover, extract and load them.

I think that "Native Library Locations" in IntelliJ only works if it points to folder locations, with pre-extracted native libraries. It probably passes those folders as paths to -Djava.library.path. LWJGL supports this too, but it means you must extract the native libraries from the jars yourself.

Brouilles

That was actually the problem, thank you for taking the time to answer me !
Best Regards.