So dynamic SFML doesn't link, neither debug nor release, while static one does fine.
The errors for release mode:
Linking CXX shared library ..\..\..\lib\sfml-graphics-2.dll
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/release/lib/libfreetype.a(sfnt.c.obj):sfnt.c:(.text+0x5e8b): undefined reference to `png_create_read_struct'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/release/lib/libfreetype.a(sfnt.c.obj):sfnt.c:(.text+0x5ea0): undefined reference to `png_create_info_struct'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/release/lib/libfreetype.a(sfnt.c.obj):sfnt.c:(.text+0x5ec3): undefined reference to `png_set_longjmp_fn'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/release/lib/libfreetype.a(sfnt.c.obj):sfnt.c:(.text+0x5efe): undefined reference to `png_destroy_read_struct'
[...]
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/release/lib/libfreetype.a(ftgzip.c.obj):ftgzip.c:(.text+0x8d9): undefined reference to `inflate'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/release/lib/libfreetype.a(ftgzip.c.obj):ftgzip.c:(.text+0x8e8): undefined reference to `inflateEnd'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/release/lib/libfreetype.a(ftgzip.c.obj):ftgzip.c:(.text+0x93a): undefined reference to `inflateEnd'
For debug mode:
Linking CXX shared library ..\..\..\lib\sfml-graphics-d-2.dll
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/debug/lib/libfreetyped.a(sfnt.c.obj): in function `error_callback':
D:/C++/.libs/FreeType/freetype-2.12.1-source/src/sfnt/pngshim.c:199: undefined reference to `png_get_error_ptr'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1-source/src/sfnt/pngshim.c:206: undefined reference to `png_set_longjmp_fn'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/debug/lib/libfreetyped.a(sfnt.c.obj): in function `read_data_from_FT_Stream':
D:/C++/.libs/FreeType/freetype-2.12.1-source/src/sfnt/pngshim.c:230: undefined reference to `png_get_io_ptr'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1-source/src/sfnt/pngshim.c:236: undefined reference to `png_get_error_ptr'
[...]
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/debug/lib/libfreetyped.a(ftgzip.c.obj): in function `ft_gzip_file_fill_output':
D:/C++/.libs/FreeType/freetype-2.12.1-source/src/gzip/ftgzip.c:454: undefined reference to `inflate'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1/mingw32-make/static/debug/lib/libfreetyped.a(ftgzip.c.obj): in function `FT_Gzip_Uncompress':
D:/C++/.libs/FreeType/freetype-2.12.1-source/src/gzip/ftgzip.c:765: undefined reference to `inflateInit2_'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1-source/src/gzip/ftgzip.c:770: undefined reference to `inflate'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1-source/src/gzip/ftgzip.c:773: undefined reference to `inflateEnd'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/C++/.libs/FreeType/freetype-2.12.1-source/src/gzip/ftgzip.c:781: undefined reference to `inflateEnd'
It happens only if
FREETYPE_INCLUDE_DIR_freetype2,
FREETYPE_INCLUDE_DIR_ft2build and
FREETYPE_LIBRARY are pointing to my self-built FreeType instead of to the bundled one, which I believe is more right than to use pre-compiled binaries, which can bang out incompatibilities or some other unpleasant things at unexpected point, don't they.
SFML_USE_SYSTEM_DEPS is set to
false all the time, if that matters.