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

Need help for linking some libraries in MSYS2 #1402

Open
L4cache opened this issue Nov 21, 2024 · 6 comments
Open

Need help for linking some libraries in MSYS2 #1402

L4cache opened this issue Nov 21, 2024 · 6 comments

Comments

@L4cache
Copy link

L4cache commented Nov 21, 2024

Backgournd: I'm implementing a process of building libheif for media-autobuild_suite.
Here's the current version of the process:
L4cache/media-autobuild_suite@7713905

There are some libraries that's difficult to link, I'll run the build and collect the error logs later.
Here's one I think I can understand:
rav1e & ffmpeg: there're some "extra libraries" that's not included in the linking command, like bcrypt for avutil.

Although I only show one program's error log, other tools failed too, just with same error.

rav1e error log:

FAILED: examples/heif-info.exe
C:\Windows\system32\cmd.exe /C "cd . && C:\mabs\msys64\mingw64\bin\ccache.exe  g++ -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -DLIBDE265_STATIC_BUILD=1 -DKVZ_STATIC_LIB=1 -DUVG_STATIC_LIB=1 -O3 -DNDEBUG -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -static-libgcc -static-libstdc++ examples/CMakeFiles/heif-info.dir/heif_info.cc.o examples/CMakeFiles/heif-info.dir/common.cc.o -o examples\heif-info.exe -Wl,--out-implib,examples\libheif-info.dll.a -Wl,--major-image-version,0,--minor-image-version,0  libheif/libheif.a  C:/mabs/local64/lib/libx265.a  C:/mabs/local64/lib/libde265.a  C:/mabs/local64/lib/libdav1d.a  C:/mabs/local64/lib/libaom.a  C:/mabs/local64/lib/libSvtAv1Enc.a  C:/mabs/local64/lib/librav1e.a  C:/mabs/msys64/mingw64/lib/libjpeg.a  C:/mabs/local64/lib/libkvazaar.a  C:/mabs/local64/lib/libuvg266.a  C:/mabs/local64/lib/libvvdec.a  C:/mabs/local64/lib/libvvenc.a  C:/mabs/msys64/mingw64/lib/libopenh264.a  C:/mabs/msys64/mingw64/lib/libsharpyuv.a  C:/mabs/msys64/mingw64/lib/libz.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/local64/lib/librav1e.a(rav1e.std-8a158a1c265395c1.std.db7f0bdc6e1939e3-cgu.0.rcgu.o.rcgu.o):std.db7f0bdc6e1939e3-cgu.0:(.text+0x21eb2): undefined reference to `NtWriteFile'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/local64/lib/librav1e.a(rav1e.std-8a158a1c265395c1.std.db7f0bdc6e1939e3-cgu.0.rcgu.o.rcgu.o):std.db7f0bdc6e1939e3-cgu.0:(.text+0x21f51): undefined reference to `RtlNtStatusToDosError'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Brotli:

FAILED: examples/heif-info.exe 
C:\Windows\system32\cmd.exe /C "cd . && C:\mabs\msys64\mingw64\bin\ccache.exe  g++ -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -DLIBDE265_STATIC_BUILD=1 -DKVZ_STATIC_LIB=1 -DUVG_STATIC_LIB=1 -O3 -DNDEBUG -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -static-libgcc -static-libstdc++ examples/CMakeFiles/heif-info.dir/heif_info.cc.o examples/CMakeFiles/heif-info.dir/common.cc.o -o examples\heif-info.exe -Wl,--out-implib,examples\libheif-info.dll.a -Wl,--major-image-version,0,--minor-image-version,0  libheif/libheif.a  C:/mabs/local64/lib/libx265.a  C:/mabs/local64/lib/libde265.a  C:/mabs/local64/lib/libdav1d.a  C:/mabs/local64/lib/libaom.a  C:/mabs/local64/lib/libSvtAv1Enc.a  C:/mabs/msys64/mingw64/lib/libjpeg.a  C:/mabs/local64/lib/libkvazaar.a  C:/mabs/local64/lib/libuvg266.a  C:/mabs/local64/lib/libvvdec.a  C:/mabs/local64/lib/libvvenc.a  C:/mabs/msys64/mingw64/lib/libopenh264.a  C:/mabs/msys64/mingw64/lib/libsharpyuv.a  C:/mabs/msys64/mingw64/lib/libz.a  C:/mabs/msys64/mingw64/lib/libbrotlidec.a  C:/mabs/msys64/mingw64/lib/libbrotlienc.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(decode.c.obj):(.text+0x3dd6): undefined reference to `BrotliTransformDictionaryWord'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(decode.c.obj):(.text+0x4ae5): undefined reference to `BrotliTransformDictionaryWord'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(decode.c.obj):(.text+0x565a): undefined reference to `BrotliSharedDictionaryAttach'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(decode.c.obj):(.rdata$.refptr._kBrotliContextLookupTable[.refptr._kBrotliContextLookupTable]+0x0): undefined reference to `_kBrotliContextLookupTable'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(decode.c.obj):(.rdata$.refptr._kBrotliPrefixCodeRanges[.refptr._kBrotliPrefixCodeRanges]+0x0): undefined reference to `_kBrotliPrefixCodeRanges'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(state.c.obj):(.text+0x120): undefined reference to `BrotliSharedDictionaryCreateInstance'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(state.c.obj):(.text+0x15b): undefined reference to `BrotliDefaultAllocFunc'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(state.c.obj):(.text+0x162): undefined reference to `BrotliDefaultFreeFunc'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(state.c.obj):(.text+0x30e): undefined reference to `BrotliSharedDictionaryDestroyInstance'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(state.c.obj):(.rdata$.refptr.BrotliDefaultFreeFunc[.refptr.BrotliDefaultFreeFunc]+0x0): undefined reference to `BrotliDefaultFreeFunc'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlidec.a(state.c.obj):(.rdata$.refptr.BrotliDefaultAllocFunc[.refptr.BrotliDefaultAllocFunc]+0x0): undefined reference to `BrotliDefaultAllocFunc'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlienc.a(encoder_dict.c.obj):(.text+0x84): undefined reference to `BrotliGetDictionary'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlienc.a(encoder_dict.c.obj):(.text+0x90): undefined reference to `BrotliGetTransforms'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlienc.a(memory.c.obj):(.text+0x1b): undefined reference to `BrotliDefaultAllocFunc'

C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libbrotlienc.a(memory.c.obj):(.text+0x22): undefined reference to `BrotliDefaultFreeFunc'

libtiff:

FAILED: examples/heif-dec.exe 
C:\Windows\system32\cmd.exe /C "cd . && C:\mabs\msys64\mingw64\bin\ccache.exe  g++ -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -DLIBDE265_STATIC_BUILD=1 -DKVZ_STATIC_LIB=1 -DUVG_STATIC_LIB=1 -O3 -DNDEBUG -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -static-libgcc -static-libstdc++ examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o examples/CMakeFiles/heif-dec.dir/common.cc.o -o examples\heif-dec.exe -Wl,--out-implib,examples\libheif-dec.dll.a -Wl,--major-image-version,0,--minor-image-version,0  libheif/libheif.a  heifio/libheifio.a  libheif/libheif.a  C:/mabs/local64/lib/libx265.a  C:/mabs/local64/lib/libde265.a  C:/mabs/local64/lib/libdav1d.a  C:/mabs/local64/lib/libaom.a  C:/mabs/local64/lib/libSvtAv1Enc.a  C:/mabs/msys64/mingw64/lib/libjpeg.a  C:/mabs/local64/lib/libkvazaar.a  C:/mabs/local64/lib/libuvg266.a  C:/mabs/local64/lib/libvvdec.a  C:/mabs/local64/lib/libvvenc.a  C:/mabs/msys64/mingw64/lib/libopenh264.a  C:/mabs/msys64/mingw64/lib/libsharpyuv.a  C:/mabs/msys64/mingw64/lib/libtiff.a  C:/mabs/msys64/mingw64/lib/libjpeg.a  C:/mabs/msys64/mingw64/lib/libpng.a  C:/mabs/msys64/mingw64/lib/libz.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x51): undefined reference to `jbg_enc_init'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x59): undefined reference to `jbg_enc_out'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x61): undefined reference to `jbg_enc_free'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0xd5): undefined reference to `jbg_dec_init'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0xe8): undefined reference to `jbg_newlen'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x101): undefined reference to `jbg_dec_in'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x113): undefined reference to `jbg_dec_getsize'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x12b): undefined reference to `jbg_dec_getimage'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x141): undefined reference to `jbg_dec_free'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x1cb): undefined reference to `jbg_strerror'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x1fe): undefined reference to `jbg_dec_free'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_jbig.o):(.text+0x252): undefined reference to `jbg_dec_free'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x109): undefined reference to `libdeflate_free_decompressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x117): undefined reference to `libdeflate_free_compressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x574): undefined reference to `lerc_encodeForVersion'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x7ed): undefined reference to `libdeflate_zlib_compress_bound'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x81a): undefined reference to `libdeflate_zlib_compress'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x87e): undefined reference to `libdeflate_alloc_compressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x8b3): undefined reference to `ZSTD_compress'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x8be): undefined reference to `ZSTD_isError'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x924): undefined reference to `ZSTD_getErrorName'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0xd4e): undefined reference to `lerc_encodeForVersion'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x10a2): undefined reference to `ZSTD_compressBound'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x13c1): undefined reference to `libdeflate_zlib_decompress'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x1405): undefined reference to `lerc_getBlobInfo'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x1557): undefined reference to `lerc_decode'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x181f): undefined reference to `ZSTD_decompress'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x182a): undefined reference to `ZSTD_isError'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x183a): undefined reference to `ZSTD_getErrorName'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x18f1): undefined reference to `libdeflate_alloc_decompressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x1b55): undefined reference to `lerc_decode'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x2074): undefined reference to `libdeflate_free_compressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x20ab): undefined reference to `ZSTD_maxCLevel'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lerc.o):(.text+0x20b4): undefined reference to `ZSTD_maxCLevel'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x170): undefined reference to `lzma_code'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x2c3): undefined reference to `lzma_code'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x373): undefined reference to `lzma_stream_encoder'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x431): undefined reference to `lzma_lzma_preset'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x466): undefined reference to `lzma_stream_encoder'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x4ef): undefined reference to `lzma_stream_decoder'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x61a): undefined reference to `lzma_code'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x630): undefined reference to `lzma_memusage'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x63e): undefined reference to `lzma_stream_decoder'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x808): undefined reference to `lzma_end'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x868): undefined reference to `lzma_end'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0x900): undefined reference to `lzma_end'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_lzma.o):(.text+0xae4): undefined reference to `lzma_lzma_preset'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xba): undefined reference to `WebPIDelete'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xc6): undefined reference to `WebPFreeDecBuffer'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x345): undefined reference to `WebPPictureFree'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x40f): undefined reference to `WebPIDelete'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x41b): undefined reference to `WebPFreeDecBuffer'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x485): undefined reference to `WebPPictureFree'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x5ba): undefined reference to `WebPPictureImportRGB'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x5d1): undefined reference to `WebPEncode'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x631): undefined reference to `WebPPictureImportRGBA'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x8d1): undefined reference to `WebPPictureInitInternal'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x8f9): undefined reference to `WebPConfigInitInternal'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x91a): undefined reference to `WebPValidateConfig'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x968): undefined reference to `WebPIDelete'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x974): undefined reference to `WebPFreeDecBuffer'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xae8): undefined reference to `WebPIAppend'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xb8e): undefined reference to `WebPGetInfo'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xcad): undefined reference to `WebPIDecGetRGB'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xd33): undefined reference to `WebPIDelete'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xd3f): undefined reference to `WebPFreeDecBuffer'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xe23): undefined reference to `WebPInitDecoderConfigInternal'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xe55): undefined reference to `WebPGetFeaturesInternal'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0xe66): undefined reference to `WebPFreeDecBuffer'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x1024): undefined reference to `WebPInitDecBufferInternal'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x1087): undefined reference to `WebPINewDecoder'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_webp.o):(.text+0x10f0): undefined reference to `WebPInitDecBufferInternal'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0xc5): undefined reference to `libdeflate_free_decompressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0xd6): undefined reference to `libdeflate_free_compressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0x2fb): undefined reference to `libdeflate_zlib_compress_bound'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0x337): undefined reference to `libdeflate_zlib_compress'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0x38b): undefined reference to `libdeflate_alloc_compressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0x85a): undefined reference to `libdeflate_zlib_decompress'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0x9e8): undefined reference to `libdeflate_alloc_decompressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zip.o):(.text+0xc5b): undefined reference to `libdeflate_free_compressor'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x93): undefined reference to `ZSTD_freeDStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0xaf): undefined reference to `ZSTD_freeCStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x17a): undefined reference to `ZSTD_compressStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x185): undefined reference to `ZSTD_isError'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x1f4): undefined reference to `ZSTD_getErrorName'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x2a0): undefined reference to `ZSTD_endStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x2ab): undefined reference to `ZSTD_isError'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x304): undefined reference to `ZSTD_getErrorName'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x36c): undefined reference to `ZSTD_initCStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x377): undefined reference to `ZSTD_isError'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x3b9): undefined reference to `ZSTD_createCStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x3f4): undefined reference to `ZSTD_getErrorName'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x4e6): undefined reference to `ZSTD_decompressStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x4f1): undefined reference to `ZSTD_isError'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x515): undefined reference to `ZSTD_getErrorName'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x63f): undefined reference to `ZSTD_initDStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x64a): undefined reference to `ZSTD_isError'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x673): undefined reference to `ZSTD_createDStream'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x6a4): undefined reference to `ZSTD_getErrorName'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x71e): undefined reference to `ZSTD_maxCLevel'
C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x727): undefined reference to `ZSTD_maxCLevel'

C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x788): undefined reference to `ZSTD_freeDStream'

C:/mabs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mabs/msys64/mingw64/lib/libtiff.a(tif_zstd.o):(.text+0x7f8): undefined reference to `ZSTD_freeCStream'

collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
@bradh
Copy link
Contributor

bradh commented Nov 21, 2024

Any extra libs should be picked up by the pkg-config tool. So investigate what is happening with that on your system.

@L4cache
Copy link
Author

L4cache commented Nov 21, 2024

Any extra libs should be picked up by the pkg-config tool. So investigate what is happening with that on your system.

I think the mechanism of find_package is different from pkg-config? There're explicit calls in CMake for pkg-config like pkg_search_module.

@kmilos
Copy link
Contributor

kmilos commented Nov 21, 2024

Indeed, https://github.com/strukturag/libheif/blob/master/cmake/modules/FindFFMPEG.cmake doesn't leverage neither the CMake config files, nor pkg-config, so looks like any dependencies are not pulled in for static linking?

Edit: had it been leveraging pkg-config instead, this is present and seems to be correct (note the Libs.private flags for static linking) on MSYS2 for e.g. libavutil.pc:

Libs: -L${libdir}  -lavutil 
Libs.private: -lva_win32 -lva -lm -lvpl -lole32 -lgdi32 -luuid -lstdc++ -luser32 -lva -lbcrypt -latomic -ldl

Similarly for rav1e.pc on MSYS2:

Libs: -L${libdir} -lrav1e
Libs.private:  -lkernel32 -ladvapi32 -lbcrypt -lkernel32 -lntdll -luserenv -lws2_32 -lkernel32 -lws2_32 -lkernel32 -lntdll -lkernel32

but that in theory should be picked up because https://github.com/strukturag/libheif/blob/master/cmake/modules/FindRAV1E.cmake is leveraging pkg-config?

@kmilos
Copy link
Contributor

kmilos commented Nov 21, 2024

So in my MSYS2 UCRT64 both

$ pkgconf --libs --static libavutil
-lavutil -lva_win32 -lva -lm -lvpl -lole32 -lgdi32 -luuid -lstdc++ -luser32 -lva -lbcrypt -latomic -ldl

and

$ pkgconf --libs --static rav1e
-lrav1e -lkernel32 -ladvapi32 -lbcrypt -lkernel32 -lntdll -luserenv -lws2_32 -lkernel32 -lws2_32 -lkernel32 -lntdll -lkernel32

seem ok, and the problem is further up in the CMake code (either CMake itself, LibFindmacros.cmake, and/or the custom libheif find modules).

@kmilos
Copy link
Contributor

kmilos commented Nov 21, 2024

For starters, it doesn't look like LibFindMacros.cmake uses the _STATIC version of variables at all provided by underlying FindPkgConfig:

Two sets of values exist: One for the common case (<XXX> = <prefix>) and another for the information pkg-config provides when called with the --static option (<XXX> = <prefix>_STATIC).

@kmilos
Copy link
Contributor

kmilos commented Nov 21, 2024

Btw, also found the need to patch the libde265.pc file for static linking, I might fix that in the MSYS2 package in the coming days:

$ pkgconf --libs --static libheif
-lheif -lstdc++ -lde265 @LIBS_PRIVATE@ -lx265 -lstdc++ -lgcc_s -lgcc -lgcc_s -lgcc -lkvazaar -lpthread -lcryptopp -laom -ldav1d -lrav1e -lkernel32 -ladvapi32 -lbcrypt -lkernel32 -lntdll -luserenv -lws2_32 -lkernel32 -lws2_32 -lkernel32 -lntdll -lkernel32 -lSvtAv1Enc -ljpeg -lopenjp2 -lm -lsharpyuv -lz -lbrotlidec -lbrotlicommon

And also this'll be needed for libheif clients: #1405

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