Reputation: 15
HelIo i am trying to make a game engine and right now to create a window with it but there is an error
I included the librarys slack-util and lwjgl before you ask me
The error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'void
org.lwjgl.opengl.WindowsDisplay.setWindowProc(java.lang.reflect.Method)'
at org.lwjgl.opengl.WindowsDisplay.setWindowProc(Native Method)
at org.lwjgl.opengl.WindowsDisplay.<clinit>(WindowsDisplay.java:218)
at org.lwjgl.opengl.Display.createDisplayImplementation(Display.java:159)
at org.lwjgl.opengl.Display.<clinit>(Display.java:136)
at com.firenet.engine.Window.createWindow(Window.java:11)
at com.firenet.engine.MainComponent.main(MainComponent.java:11)
Window.java:
package com.firenet.engine;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
public class Window
{
public static void createWindow(int width, int height, String title)
{
Display.setTitle("Test!");
try
{
Display.setDisplayMode(new DisplayMode(width, height));
Display.create();
}
catch (LWJGLException e)
{
e.printStackTrace();
}
}
}
MainComponent.java:
package com.firenet.engine;
public class MainComponent
{
public static final int width = 600;
public static final int height = 500;
public static final String title = "Test!";
public static void main(String[] args)
{
Window.createWindow(width, height, title);
}
}
Upvotes: 0
Views: 592
Reputation: 176
Your problem seems to be that you have not added the "native" folder to your build path. I have created a project based on the code that you mentioned in the question. After adding the 'natives' correctly I ran your code, and it shows me a blank black window which closes after some time. Try the following:
After this run your application and hopefully you will see a blank window like I see when I run it on my machine.
Upvotes: 2