Skip to content

ImGui can't access static fields and members of org.lwjgl.stb.STBRPRect #179

@Cavantar

Description

@Cavantar

Hi
I've been trying to solve this for a day and I don't really know what else to do.
I'm using imgui v1.79, lwjgl 3.3.1 and jdk11.
For some reason app crashes inside the lib with:

Exception in thread "main" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoSuchMethodError: org.lwjgl.stb.STBRPRect.nw(JS)V
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:172)
	at com.jbidev.nothing.DesktopLauncher.main(DesktopLauncher.java:17)
Caused by: java.lang.NoSuchMethodError: org.lwjgl.stb.STBRPRect.nw(JS)V
Caused by: java.lang.NoSuchMethodError: org.lwjgl.stb.STBRPRect.nw(JS)V

	at imgui.stb.ExtensionsKt.setW(extensions.kt:30)
	at imgui.font.FontAtlas.buildWithStbTrueType(FontAtlas.kt:720)
	at imgui.font.FontAtlas.build(FontAtlas.kt:202)
	at imgui.font.FontAtlas.getTexDataAsAlpha8(FontAtlas.kt:212)
	at imgui.font.FontAtlas.getTexDataAsRGBA32(FontAtlas.kt:222)
	at imgui.impl.gl.ImplGL3.createFontsTexture(ImplGL3.kt:225)
	at imgui.impl.gl.ImplGL3.createDeviceObjects(ImplGL3.kt:275)
	at imgui.impl.gl.ImplGL3.newFrame(ImplGL3.kt:61)

I can easily access stb methods and constants from the main app, but inside the imgui lib I can only create instances and access class methods, static members don't work at all giving error:

Symbol is declared in module 'org.lwjgl.stb' which current module does not depend on

Does anybody knows, how to fix this, is this caused by my setup ?
I don't have much experience with gradle and kotlin so any help would be appreciated .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions