rageworx / moonfltk

Lua bindings for FLTK, enhanced little bit more.
Other
0 stars 0 forks source link

module 'moonfltk ' not found #5

Open rageworx opened 1 year ago

rageworx commented 1 year ago

On MinGW-W64, moonfltk 1.4-work compilation successfully done. But module shouldn't be loaded while default example, unittest.lua.

❯ examples/fltk/unittests.lua
C:\msys64\usr\local\bin\lua.exe: examples/fltk/unittests.lua:7: module 'moonfltk
' not found:
        no field package.preload['moonfltk']
        no file 'C:\msys64\usr\local\bin\lua\moonfltk.lua'
        no file 'C:\msys64\usr\local\bin\lua\moonfltk\init.lua'
        no file 'C:\msys64\usr\local\bin\moonfltk.lua'
        no file 'C:\msys64\usr\local\bin\moonfltk\init.lua'
        no file 'C:\msys64\usr\local\bin\..\share\lua\5.3\moonfltk.lua'
        no file 'C:\msys64\usr\local\bin\..\share\lua\5.3\moonfltk\init.lua'
        no file '.\moonfltk.lua'
        no file '.\moonfltk\init.lua'
        no file 'C:\msys64\usr\local\bin\moonfltk.dll'
        no file 'C:\msys64\usr\local\bin\..\lib\lua\5.3\moonfltk.dll'
        no file 'C:\msys64\usr\local\bin\loadall.dll'
        no file '.\moonfltk.dll'
stack traceback:
        [C]: in function 'require'
        examples/fltk/unittests.lua:7: in main chunk
        [C]: in ?
rageworx commented 1 year ago

Default library of moonfltk installs to path of "/MinGW64/share/lua/5.4/moonfltk". It is not a reachable path on lua5.3, which is right ?

❯ make install
make[1]: Entering directory '/d/Projects/moonfltk/src'
'moonfltk.h' -> '/mingw64/include/moonfltk.h'
'../moonfltk/timer.lua' -> '/mingw64/share/lua/5.4/moonfltk/timer.lua'
'../moonfltk/timer_.lua' -> '/mingw64/share/lua/5.4/moonfltk/timer_.lua'
'moonfltk.dll' -> '/mingw64/lib/lua/5.4/moonfltk.dll'
make[1]: Leaving directory '/d/Projects/moonfltk/src'
rageworx commented 1 year ago

Copied moonfltk.dll and timer.lua in running directory, and luanched unittest, and found "Cannot locate procedure" ? What procedure ?

❯ examples/fltk/unittests.lua
C:\msys64\usr\local\bin\lua.exe: error loading module 'moonfltk' from file '.\mo
onfltk.dll':
        지정된 프로시저를 찾을 수 없습니다.

stack traceback:
        [C]: in ?
        [C]: in function 'require'
        examples/fltk/unittests.lua:7: in main chunk
        [C]: in ?

Is it an issue belong to Windows 64 PE image entry point of DLL ?

rageworx commented 1 year ago

Tested with DLL explorer, moonfltk.dll loads as well.

image

rageworx commented 1 year ago

lua53.dll dependency:

❯ ldd lua53.dll
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff8ad230000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ff8acf60000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ff8aafa0000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ff8abf60000)
rageworx commented 1 year ago

moonfltk.dll dependency:

❯ ldd moonfltk.dll
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff8ad230000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ff8acf60000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ff8aafa0000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ff8abf60000)
        COMCTL32.dll => /c/WINDOWS/WinSxS/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.1110_none_792d1c772443f647/COMCTL32.dll (0x7ff884bc0000)
        comdlg32.dll => /c/WINDOWS/System32/comdlg32.dll (0x7ff8ab630000)
        ADVAPI32.dll => /c/WINDOWS/System32/ADVAPI32.dll (0x7ff8ab960000)
        combase.dll => /c/WINDOWS/System32/combase.dll (0x7ff8aca70000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ff8aaa00000)
        sechost.dll => /c/WINDOWS/System32/sechost.dll (0x7ff8ac000000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ff8acdd0000)
        rpcrt4.dll => /c/Windows/System32/rpcrt4.dll (0x237608d0000)
        shcore.dll => /c/WINDOWS/System32/shcore.dll (0x7ff8ab4d0000)
        GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7ff8abac0000)
        win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7ff8aa9d0000)
        USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7ff8ab320000)
        gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7ff8aac90000)
        SHLWAPI.dll => /c/WINDOWS/System32/SHLWAPI.dll (0x7ff8ac860000)
        msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7ff8ab280000)
        SHELL32.dll => /c/WINDOWS/System32/SHELL32.dll (0x7ff8ac100000)
        ole32.dll => /c/WINDOWS/System32/ole32.dll (0x7ff8ab830000)
        gdiplus.dll => /c/WINDOWS/WinSxS/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.2251_none_91a40448cc8846c1/gdiplus.dll (0x7ff88f570000)
        WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ff8ab590000)
        libgcc_s_seh-1.dll => /mingw64/bin/libgcc_s_seh-1.dll (0x7ff889b50000)
        GLU32.dll => /c/WINDOWS/SYSTEM32/GLU32.dll (0x7ff877470000)
        OPENGL32.dll => /c/WINDOWS/SYSTEM32/OPENGL32.dll (0x7ff877210000)
        libstdc++-6.dll => /mingw64/bin/libstdc++-6.dll (0x7ff84db30000)
        libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x7ff8a6380000)
        IMM32.DLL => /c/WINDOWS/System32/IMM32.DLL (0x7ff8ab600000)
        CRYPTBASE.DLL => /c/WINDOWS/SYSTEM32/CRYPTBASE.DLL (0x7ff8aa3a0000)
        bcryptPrimitives.dll => /c/WINDOWS/System32/bcryptPrimitives.dll (0x7ff8aab50000)

Maybe libgcc and libstdc++6 and some MinGW requirements 'caused to load failure ?

rageworx commented 1 year ago

Trying to static build for mingw platform -> Same.