mpv-player / mpv-build

🔨 Helper scripts to compile mpv on Linux
http://mpv.io
414 stars 108 forks source link

Two DLL files are not linked on my libmpv shared with static build on Windows MSYS2. #195

Closed MartinEesmaa closed 2 years ago

MartinEesmaa commented 2 years ago

Hi, I have a problem. The two DLL files are not linked probably contains: libgcc_s_seh-1.dll & libwinpthread-1.dll.

My waf configure build mpv with libmpv shared + static build:

./waf configure --enable-static-build --enable-libmpv-shared --disable-jpeg

Two DLL files are not probably well after the build success:

$ ldd build/mpv-2.dll
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffb71b40000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffb713e0000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffb6f020000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffb705d0000)
        ADVAPI32.dll => /c/WINDOWS/System32/ADVAPI32.dll (0x7ffb71a20000)
        sechost.dll => /c/WINDOWS/System32/sechost.dll (0x7ffb6fb50000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ffb71730000)
        GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7ffb71530000)
        win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7ffb6f5e0000)
        bcrypt.dll => /c/WINDOWS/SYSTEM32/bcrypt.dll (0x7ffb6ea00000)
        gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7ffb6f7f0000)
        msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7ffb6f540000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ffb6f420000)
        USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7ffb711d0000)
        IMM32.dll => /c/WINDOWS/System32/IMM32.dll (0x7ffb71190000)
        ole32.dll => /c/WINDOWS/System32/ole32.dll (0x7ffb70ec0000)
        combase.dll => /c/WINDOWS/System32/combase.dll (0x7ffb70250000)
        OLEAUT32.dll => /c/WINDOWS/System32/OLEAUT32.dll (0x7ffb71940000)
        SETUPAPI.dll => /c/WINDOWS/System32/SETUPAPI.dll (0x7ffb6fbf0000)
        SHELL32.dll => /c/WINDOWS/System32/SHELL32.dll (0x7ffb70680000)
        SHLWAPI.dll => /c/WINDOWS/System32/SHLWAPI.dll (0x7ffb71070000)
        WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ffb70060000)
        dwmapi.dll => /c/WINDOWS/SYSTEM32/dwmapi.dll (0x7ffb6c9b0000)
        AVRT.dll => /c/WINDOWS/SYSTEM32/AVRT.dll (0x7ffb68720000)
        libgcc_s_seh-1.dll => /mingw64/bin/libgcc_s_seh-1.dll (0x7ffb5f470000)
        VERSION.dll => /c/WINDOWS/SYSTEM32/VERSION.dll (0x7ffb66280000)
        OPENGL32.dll => /c/WINDOWS/SYSTEM32/OPENGL32.dll (0x7ffacb670000)
        Secur32.dll => /c/WINDOWS/SYSTEM32/Secur32.dll (0x7ffb56400000)
        USP10.dll => /c/WINDOWS/SYSTEM32/USP10.dll (0x7ffb55740000)
        AVICAP32.dll => /c/WINDOWS/SYSTEM32/AVICAP32.dll (0x7ffb5f450000)
        WINMM.dll => /c/WINDOWS/SYSTEM32/WINMM.dll (0x7ffb68070000)
        SSPICLI.DLL => /c/WINDOWS/SYSTEM32/SSPICLI.DLL (0x7ffb6e430000)
        GLU32.dll => /c/WINDOWS/SYSTEM32/GLU32.dll (0x7ffacb640000)
        MSVFW32.dll => /c/WINDOWS/SYSTEM32/MSVFW32.dll (0x7ffb5f420000)
        libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x7ffb5f400000)
        cfgmgr32.DLL => /c/WINDOWS/SYSTEM32/cfgmgr32.DLL (0x7ffb6ed20000)
        dxcore.dll => /c/WINDOWS/SYSTEM32/dxcore.dll (0x7ffb6c920000)
        COMCTL32.dll => /c/WINDOWS/WinSxS/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.22000.1_none_271a8fad6a2d1b1e/COMCTL32.dll (0x7ffb5b0e0000)

Any solutions to get rid off libwinpthread-1.dll & libgcc_s_seh-1.dll?

sfan5 commented 2 years ago

-static-libgcc in LDFLAFGS can get rid of one of them, not sure about winpthreads

MartinEesmaa commented 2 years ago

-static-libgcc in LDFLAFGS can get rid of one of them, not sure about winpthreads

@sfan5, thank you for fixing my issue. I added LDFLAGS="-static" solves my problem to link all together.