MightyPrinny / godot-FLMusicLib

GDNative library that plays mp3, chiptune and tracker music files using Game Music Emu, Minimp3 and openmpt
Creative Commons Zero v1.0 Universal
51 stars 7 forks source link

Forgot to load Dependencies for Windows version of library in the GDNativeLib file #5

Closed JOELwindows7 closed 3 years ago

JOELwindows7 commented 3 years ago

Which causes if the project exported, only Windows version will suffer from error no such method

Checked file:

both files above forgot to load Dependency .dll files for Windows version of the Native Library. It seems for Windows version, the .dll library is separated hence the main FLMusicLib.dll requires dependencies which included next to it. for other platform, such as Linux, and Android, already had all in one .so file, so I suspect that it no longer require to have dependency.

previous detail: https://github.com/godotengine/godot/issues/42777

Generated error

bellow is the debug console output of exported application which is FLMusicLib demo.

Godot Engine v3.2.3.stable.official - https://godotengine.org
Using GLES2 video driver
OpenGL ES 2.0 Renderer: GeForce GTX 1050 Ti/PCIe/SSE2
OpenGL ES 2.0 Batching: ON
        OPTIONS
        max_join_item_commands 16
        colored_vertex_format_threshold 0.25
        batch_buffer_size 16384
        light_scissor_area_threshold 1
        item_reordering_lookahead 4
        light_max_join_items 32
        single_rect_fallback False
        debug_flash False
        diagnose_frame False
WASAPI: wFormatTag = 65534
WASAPI: nChannels = 8
WASAPI: nSamplesPerSec = 48000
WASAPI: nAvgBytesPerSec = 1536000
WASAPI: nBlockAlign = 32
WASAPI: wBitsPerSample = 32
WASAPI: cbSize = 22
WASAPI: detected 8 channels
WASAPI: audio buffer frames: 1962 calculated latency: 44ms

Loading resource: res://FLMusicLib/FLMusicLib.gdnlib
ERROR: Can't open dynamic library: FLMusicLib/Windows/x86/FLMusicLib.dll, error: Error 126: The specified module could not be found.
.
   At: platform/windows/os_windows.cpp:2395
CORE API HASH: 17947557007960061372
EDITOR API HASH: 3270892295
Loading resource: res://default_env.tres
Loading resource: res://global.gdc
Loading resource: res://FLMusicLib/FLMusic.gdns
Loading resource: res://FLMusicLib/FLMusicLib.gdnlib
ERROR: Can't open dynamic library: FLMusicLib/Windows/x86/FLMusicLib.dll, error: Error 126: The specified module could not be found.
.
   At: platform/windows/os_windows.cpp:2395
ERROR: get_symbol: No valid library handle, can't get symbol from GDNative object
   At: modules/gdnative/gdnative.cpp:501
ERROR: init_library: No nativescript_init in "res://FLMusicLib/Windows/x86/FLMusicLib.dll" found
   At: modules/gdnative/nativescript/nativescript.cpp:1506
SCRIPT ERROR: _init: Attempt to call function 'new' in base 'NativeScript' on a null instance.
          At: res://global.gdc:8
Loaded builtin certs
Loading resource: res://MyScene.tscn
Loading resource: res://MyScene.gdc
Loading resource: res://TrackList.gdc
ERROR: add_child: Parameter "p_child" is null.
   At: scene/main/node.cpp:1174
SCRIPT ERROR: _ready: Invalid call. Nonexistent function 'set_gme_buffer_size' in base 'Nil'.
          At: res://global.gdc:12
SCRIPT ERROR: _ready: Invalid call. Nonexistent function 'connect' in base 'Nil'.
          At: res://MyScene.gdc:23
SCRIPT ERROR: _play_music: Invalid call. Nonexistent function 'play_music' in base 'Nil'.
          At: res://MyScene.gdc:30
SCRIPT ERROR: _play_music: Invalid call. Nonexistent function 'play_music' in base 'Nil'.
          At: res://MyScene.gdc:30
SCRIPT ERROR: _play_music: Invalid call. Nonexistent function 'play_music' in base 'Nil'.
          At: res://MyScene.gdc:30

to even clarify, I also implemented the FLMusicLib into my own project, made the implementation to use that when the music file is the format for the GMEPlayer, and it resulted the same. Invalid call. Nonexistent function 'play_music' in base 'Nil'

...
res://GameDVDCardtridge/TemplateHexagonEngine/LevelCardtridge/MusicEnjoy/MusicRoom3D.tscn
Queueing Scene res://GameDVDCardtridge/TemplateHexagonEngine/LevelCardtridge/MusicEnjoy/MusicRoom3D.tscn
Queueing Scene res://GameDVDCardtridge/TemplateHexagonEngine/LevelCardtridge/MusicEnjoy/MusicRoom2D.tscn
Set Statuso Flag
Set Statuso Flag
Queue is ready res://GameDVDCardtridge/TemplateHexagonEngine/LevelCardtridge/MusicEnjoy/MusicRoom3D.tscn
Connect Signal 3D
Queue is ready res://GameDVDCardtridge/TemplateHexagonEngine/LevelCardtridge/MusicEnjoy/MusicRoom2D.tscn
Testoid Location= C:/Users/joelr/AppData/Roaming/Perkedel Technologies/Hexagon Engine/TestoidDummy.txt
SCRIPT ERROR: _ready: Invalid call. Nonexistent function 'connect' in base 'Nil'.
          At: res://GameDVDCardtridge/TemplateHexagonEngine/LevelCardtridge/MusicEnjoy/MusicRoom2D.gdc:59
Connect Signal 2D
Show UI Gameplay

(NOTICE)PLEASE DON'T LOSE THE CRACKLES!!! LEFT 15 PCS!!! (NOTICE)

Body Out of Bound = TestoidDrop
openFile = D:/PRIVATE FOLDER/FILE JOEL ROBERT/MP3/Tobu/Tobu - Calling.mp3
Use GME = D:/PRIVATE FOLDER/FILE JOEL ROBERT/MP3/Tobu/Tobu - Calling.mp3
SCRIPT ERROR: PlaySong: Invalid call. Nonexistent function 'play_music' in base 'Nil'.
          At: res://GameDVDCardtridge/TemplateHexagonEngine/LevelCardtridge/MusicEnjoy/MusicRoom2D.gdc:127

fixing problem

Solution

singleton=true load_once=true symbolprefix="godot" reloadable=true

[entry]

Android.armeabi-v7a="res://FLMusicLib/Android/armv7a/libFLMusicLib.so" Android.arm64-v8a="res://FLMusicLib/Android/armv8-64/libFLMusicLib.so" Windows.64="res://FLMusicLib/Windows/x64/FLMusicLib.dll" Windows.32="res://FLMusicLib/Windows/x86/FLMusicLib.dll" X11.64="res://FLMusicLib/Linux/x64/libFLMusicLib.so.1.0.0"

[dependencies]

Android.armeabi-v7a=[ ] Android.arm64-v8a=[ ] Windows.64=[ "res://FLMusicLib/Windows/x64/libopenmpt.dll", "res://FLMusicLib/Windows/x64/openmpt-mpg123.dll", "res://FLMusicLib/Windows/x64/openmpt-ogg.dll", "res://FLMusicLib/Windows/x64/openmpt-vorbis.dll", "res://FLMusicLib/Windows/x64/openmpt-zlib.dll" ] Windows.32=[ "res://FLMusicLib/Windows/x86/libopenmpt.dll", "res://FLMusicLib/Windows/x86/openmpt-mpg123.dll", "res://FLMusicLib/Windows/x86/openmpt-ogg.dll", "res://FLMusicLib/Windows/x86/openmpt-vorbis.dll", "res://FLMusicLib/Windows/x86/openmpt-zlib.dll" ] X11.64=[ ]


notice that in the section `[dependencies]`, I manually added other DLL files for Windows version, which you already aware that following fields above are empty. this way, made the WIndows version export finally works.
JOELwindows7 commented 3 years ago

I should create pull request simply to fix this missing

JOELwindows7 commented 3 years ago

Yeah! pull request!!

https://github.com/MightyPrinny/godot-FLMusicLib/pull/7

https://github.com/MightyPrinny/godot-FLMusicLib/pull/6

Be sure to test this first!

Keys for the test:

MightyPrinny commented 3 years ago

Thank you

JOELwindows7 commented 3 years ago

Thank you

no problem. glad to help.