Hello Guest

[FIXED] GLFW Error "java.lang.UnsatisfiedLinkError"

  • 8 Replies
  • 12322 Views
[FIXED] GLFW Error "java.lang.UnsatisfiedLinkError"
« on: November 17, 2014, 17:55:32 »
So I'm updating my project so that it uses the new LWJGL3 rather than 2.9.x.

I think I have most of the code that replaces "Display" set up right from following this http://www.lwjgl.org/guide and looking on the GLFW site, but when I try and run my code I get the following.
Code: [Select]
Exception in thread "Test" java.lang.UnsatisfiedLinkError: org.lwjgl.system.glfw.ErrorCallback$Util.setCallback(Ljava/lang/reflect/Method;)J
at org.lwjgl.system.glfw.ErrorCallback$Util.setCallback(Native Method)
at org.lwjgl.system.glfw.ErrorCallback$Util.<clinit>(ErrorCallback.java:61)
at GameEngine.Render.GameDisplay.createNewDisplay(GameDisplay.java:20)
at GameEngine.Render.Render.init(Render.java:56)
at GameEngine.Render.Render.<init>(Render.java:52)
at GameEngine.Render.DefaultRender.<init>(DefaultRender.java:26)
at GameEngine.GameEngine$Engine.initEngine(GameEngine.java:70)
at GameEngine.GameEngine$Engine.run(GameEngine.java:59)
at java.lang.Thread.run(Unknown Source)

The line that causes it is the following
Code: [Select]
GLFW.glfwSetErrorCallback(ErrorCallback.Util.getDefault());Which is pretty much the first method called in the method, before that the only thing there is, is an initialized long variable, "window".

So what is the cause for the error?

Extra Info:
GameDisplay is a class containing static methods that are to do with window creation, atm there is a method "createNewDisplay" and "changeResolution".
Render is an abstract class that DefaultRender extends and then fully implements some of the methods.
Will soon be an Oracle Certified Associate :D

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #1 on: November 17, 2014, 17:58:57 »
Call Sys.touch(); before setting up the error callback. This is a temporary workaround and will be fixed soon, see this issue.

Re: GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #2 on: November 17, 2014, 18:00:27 »
Ah, ok, thanks.
Also, what can I call instead of GLU.gluErrorString()?
Edit:
Had a quick look through the API, would Uitl.translateGLErrorString(int errorCode) do the trick?
« Last Edit: November 17, 2014, 18:12:48 by bogieman987 »
Will soon be an Oracle Certified Associate :D

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #3 on: November 17, 2014, 18:09:46 »
You can use org.lwjgl.opengl.Util.translateGLErrorString(int errorCode)

Re: GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #4 on: November 17, 2014, 18:13:01 »
Haha, you posted just before I finished editing my previous post.
And thanks.
Will soon be an Oracle Certified Associate :D

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #5 on: November 18, 2014, 11:28:47 »
The original issue has been resolved, there is no need  anymore to call Sys.touch() explicitly.

Re: [FIXED] GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #6 on: November 22, 2014, 17:23:23 »
quick report: got the same error (unsatisfied link error when calling glfwSetErrorCallback). Using Sys.touch fixed it. Using the stable release from the download page.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: [FIXED] GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #7 on: November 22, 2014, 17:59:07 »
Have you tried with the latest nightly?

Re: [FIXED] GLFW Error "java.lang.UnsatisfiedLinkError"
« Reply #8 on: November 22, 2014, 19:33:03 »
just tried with the latest nightly (red, bleeding edge link!) and worked without the Sys.touch.

I could even register my own callback (scala):

Code: [Select]
glfwSetErrorCallback(new ErrorCallback.StrAdapter() {
      override def invoke(e: Int, d: String) = { quit(new RuntimeException(s"$e: $d")) }})