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

(25+dev-SNAPSHOT): FXGL-ShaderExample does not run for me on Windows 11 with an exception "Cannot open library..." #1394

Open
steinmartin opened this issue Dec 29, 2024 · 5 comments

Comments

@steinmartin
Copy link

steinmartin commented Dec 29, 2024

After cloning the https://github.com/AlmasB/FXGL-ShaderExample on a box with Windows 11 x86_64,
I get the following exception:

18:35:34.352 [FFCThread-0              ] WARN  ForeignFunctionCalle - FFCThread task failed
    java.lang.IllegalArgumentException: Cannot open library: C:\Users\martin\.openjfx\cache\fxgl-21\gl\fxgl-shaderlib.dll
    at java.base/java.lang.foreign.SymbolLookup.libraryLookup(SymbolLookup.java:348)
    at java.base/java.lang.foreign.SymbolLookup.libraryLookup(SymbolLookup.java:333)
    at com.almasb.fxgl.core.reflect.ForeignFunctionCaller.lambda$threadTask$0(ForeignFunctionCaller.java:92)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at com.almasb.fxgl.core.reflect.ForeignFunctionCaller.threadTask(ForeignFunctionCaller.java:91)
    at java.base/java.lang.Thread.run(Thread.java:1575)

The JDK versions I tried were:

  • liberica-full-23.0.1
  • temurin-23.0.1
  • openjdk-23.0.1

The fxgl-shaderlib.dll is present in the cache.

The full startup log is:

- openjdk-23.0.118:35:32.298 [JavaFX Application Thread] INFO  Engine               - FXGL-25+dev-SNAPSHOT (28.12.2024 08.41) on 
- WINDOWS (J:23.0.1 FX:23.0.1+1)
18:35:32.300 [JavaFX Application Thread] INFO  Engine               - Source code and latest versions at: 
https://github.com/AlmasB/FXGL
18:35:32.300 [JavaFX Application Thread] INFO  Engine               -       Ask questions and discuss at: 
https://github.com/AlmasB/FXGL/discussions
18:35:32.300 [JavaFX Application Thread] INFO  Engine               -              Join the FXGL chat at: https://gitter.im/AlmasB/FXGL
18:35:33.850 [FXGL Background Thread 1 ] INFO  FXGLApplication      - FXGL initialization took: 0.897 sec   
18:35:34.060 [FXGL Background Thread 4 ] INFO  FXGLApplication      - Game initialization took: 0.090 sec
18:35:34.352 [FFCThread-0              ] WARN  ForeignFunctionCalle - FFCThread task failed
java.lang.IllegalArgumentException: Cannot open library: C:\Users\martin\.openjfx\cache\fxgl-21\gl\fxgl-shaderlib.dll
          at java.base/java.lang.foreign.SymbolLookup.libraryLookup(SymbolLookup.java:348)
      at java.base/java.lang.foreign.SymbolLookup.libraryLookup(SymbolLookup.java:333)
      at com.almasb.fxgl.core.reflect.ForeignFunctionCaller.lambda$threadTask$0(ForeignFunctionCaller.java:92)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
      at com.almasb.fxgl.core.reflect.ForeignFunctionCaller.threadTask(ForeignFunctionCaller.java:91)
      at java.base/java.lang.Thread.run(Thread.java:1575)

18:35:34.763 [FXGL Background Thread 2 ] INFO  UpdaterService       - Your current version:  25+dev-SNAPSHOT
18:35:34.763 [FXGL Background Thread 2 ] INFO  UpdaterService       - Latest stable version: 21.1
@steinmartin steinmartin changed the title (25+dev-SNAPSHOT) : FXGL-ShaderExample does not run for me on Windows 11 with an exception "Can not open library...". (25+dev-SNAPSHOT) : FXGL-ShaderExample does not run for me on Windows 11 with an exception "Cannot open library..." Dec 29, 2024
@steinmartin steinmartin changed the title (25+dev-SNAPSHOT) : FXGL-ShaderExample does not run for me on Windows 11 with an exception "Cannot open library..." (25+dev-SNAPSHOT): FXGL-ShaderExample does not run for me on Windows 11 with an exception "Cannot open library..." Dec 29, 2024
@AlmasB
Copy link
Owner

AlmasB commented Dec 29, 2024

Thanks for this. Could you also confirm that "SDL2.dll" and "glew32.dll" are in the ...\cache\fxgl-21\gl\ directory?

I've tried running the demo with the same version 28.12.2024 08.41 with a cleared cache and it seems fine. So, my initial thought is there might be some .dlls (opengl32.dll or similar) not being loaded properly in the above case. Are you running in a virtual environment by any chance?

@steinmartin
Copy link
Author

steinmartin commented Dec 30, 2024

Both "SDL2.dll " and "glew32.dll" are in the ...\cache\fxgl-21\gl\ directory. I cleared cache ones and they returned correctly.

imagem

I am not on a virtual environment:

Edition Windows 11 Home Version 23H2 Installed on ‎12/‎28/‎2024 OS build 22631.4602 .... Experience Windows Feature Experience Pack 1000.22700.1055.0

I checked for the opengl32.dll and it has a size of 933,888 bytes. If you have further ideas it would be my pleasure to help.

@AlmasB
Copy link
Owner

AlmasB commented Dec 30, 2024

Thank you for the offer.

It loads them in the order of SDL2, glew32, fxgl-shaderlib, so I assume the first two (and their deps) are loaded correctly. The last one has these unique deps:

MSVCP140D.dll => /c/Windows/SYSTEM32/MSVCP140D.dll
VCRUNTIME140_1D.dll => /c/Windows/SYSTEM32/VCRUNTIME140_1D.dll
VCRUNTIME140D.dll => /c/Windows/SYSTEM32/VCRUNTIME140D.dll
ucrtbased.dll => /c/Windows/SYSTEM32/ucrtbased.dll

Could you check these please, and list all of the missing ones (if any?). If this is the cause, I might need to link downloads via Microsoft VC++ Redist.

@steinmartin
Copy link
Author

MSVCP140D.dll not present:
Screenshot 2024-12-30 210142

VCRUNTIME140_1D.dll and VCRUNTIME140D.dll not present:
imagem

ucrtbased.dll not present:
imagem

Thanks for hanging on...

@lazyfish-zcw
Copy link

Have you solved this problem, brother? I encountered the same problem and downloaded the above four DLL files, which were placed in the System32 folder, but the problem still hasn't been resolved

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

3 participants