Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Cavantar opened this issue Jul 31, 2022 · 3 comments
Open

Comments

@Cavantar
Copy link

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 .

@tasgon
Copy link
Contributor

tasgon commented Aug 1, 2022

As far as I can tell, the issue is that kotlin-imgui passes in a short to a function that expects an int, however I thought Java does primitive widening so that shouldn't be the case.

@Sylvyrfysh
Copy link
Collaborator

Sylvyrfysh commented Oct 11, 2022 via email

@elect86
Copy link
Collaborator

elect86 commented Nov 3, 2022

Sorry for the delay, I just updated it, could you give it a try?

implementation("kotlin.graphics:imgui-core:1.79+05")
implementation("kotlin.graphics:imgui-gl:1.79+05")
implementation("kotlin.graphics:imgui-glfw:1.79+05")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants