Closed jrosener closed 1 year ago
This issue could be reproduced with vcpkg 2023-04-07-bedcba5172f5e4b91caac660ab7afe92c27a9895.
BUILD_ARCH=x86_64
OPTION_VARIABLE=OPTIONS_x86_64
=== CONFIGURING ===
ERROR: libopenmpt >= 0.2.6557 not found using pkg-config
A "workaround" for building
ffmpeg
is to removeopenmpt
fromffmpeg
dependencies.
@jrosener
I'm having some trouble myself installing ffmpeg
- how did you go about using this workaround? Not sure how to remove a dependency when going through the installation process. Thanks!
@Adela0814 If you also know how to do this, adding the workaround to this issue will help a lot 🙂
@simcard0000 just remove openmpt
from the list of ffmpeg
's dependencies in ports/ffmpeg/vcpkg.json
and start again the build with vcpkg install ffmpeg[all-nonfree,ffmpeg,ffprobe,ffplay]:x64-windows-static
:
diff --git a/ports/ffmpeg/vcpkg.json b/ports/ffmpeg/vcpkg.json
index 0c6330ccd..09dad288f 100644
--- a/ports/ffmpeg/vcpkg.json
+++ b/ports/ffmpeg/vcpkg.json
@@ -45,7 +45,6 @@
"lzma",
"mp3lame",
"openjpeg",
- "openmpt",
"opus",
"snappy",
"soxr",
Of course it's not an acceptable workaround if you need to use ffmpeg for demuxing tracker audio format against libopenmpt.
@jrosener Thanks! 🙌🏽
The static version of libopenmpt requires an explicit linking to a Windows library (Shlwapi), but the pkgconfig file for libopenmpt does not describe this link.
This can be "solved" by editing the libopenmpt.pc file, and changing the line
Libs: "-L${prefix}/lib" -lopenmpt
to
Libs: "-L${prefix}/lib" -lopenmpt -lShlwapi
Build still fails with the new ports of ffmpeg 6.0
To fix it, I think that ports\libopenmpt\CMakeLists.txt
should contain something like this :
if((NOT BUILD_SHARED_LIBS) AND WIN32)
set(LIBOPENMPT_LIBS_PRIVATE "-lShlwapi")
else()
set(LIBOPENMPT_LIBS_PRIVATE "")
endif()
As a consequence libopenmpt.pc
will contain the missing -lShlwapi
in case of a Windows static build.
test_ld cc -ID:/installed/x64-windows-static/include -LD:/installed/x64-windows-static/lib -lopenmpt -lzlib -lvorbisfile -lvorbis -logg -lmpg123 -lstdc++
test_cc -ID:/installed/x64-windows-static/include -libpath:D:/installed/x64-windows-static/lib
BEGIN ./ffconf.SiE1gC11/test.c
1 #include <libopenmpt/libopenmpt.h>
2 #include <stdint.h>
3 long check_openmpt_module_create(void) { return (long) openmpt_module_create; }
4 int main(void) { int ret = 0;
5 ret |= ((intptr_t)check_openmpt_module_create) & 0xFFFF;
6 return ret; }
END ./ffconf.SiE1gC11/test.c
cl.exe -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_WIN32_WINNT=0x0600 -DPIC @D:/buildtrees/ffmpeg/x64-windows-static-rel/cflags.rsp -nologo -DHAVE_UNISTD_H=0 -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include/harfbuzz -ID:/installed/x64-windows-static/include/libpng16 -ID:/installed/x64-windows-static/include/fribidi -DFRIBIDI_LIB_STATIC -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include/libpng16 -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include/libpng16 -ID:/installed/x64-windows-static/include/fribidi -DFRIBIDI_LIB_STATIC -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -ID:/installed/x64-windows-static/include -libpath:D:/installed/x64-windows-static/lib -c -Fo./ffconf.SiE1gC11/test.o ./ffconf.SiE1gC11/test.c
cl : Command line warning D9002 : ignoring unknown option '-libpath:D:/installed/x64-windows-static/lib'
test.c
./ffconf.SiE1gC11/test.c(3): warning C4311: 'type cast': pointer truncation from 'openmpt_module *(__cdecl *)(openmpt_stream_callbacks,void *,openmpt_log_func,void *,const openmpt_module_initial_ctl *)' to 'long'
./ffconf.SiE1gC11/test.c(3): warning C4996: 'openmpt_module_create': was declared deprecated
link.exe @D:/buildtrees/ffmpeg/x64-windows-static-rel/ldflags.rsp -nologo -ID:/installed/x64-windows-static/include -libpath:D:/installed/x64-windows-static/lib -out:./ffconf.SiE1gC11/test.exe ./ffconf.SiE1gC11/test.o openmpt.lib zlib.lib vorbisfile.lib vorbis.lib ogg.lib mpg123.lib
LINK : warning LNK4044: unrecognized option '/ID:/installed/x64-windows-static/include'; ignored
mpg123.lib(compat.c.obj) : error LNK2019: unresolved external symbol __imp_PathCombineW referenced in function INT123_compat_catpath
mpg123.lib(compat.c.obj) : error LNK2019: unresolved external symbol __imp_PathIsRelativeW referenced in function u2wlongpath
mpg123.lib(compat.c.obj) : error LNK2019: unresolved external symbol __imp_PathIsUNCW referenced in function u2wlongpath
.\ffconf.SiE1gC11\test.exe : fatal error LNK1120: 3 unresolved externals
ERROR: libopenmpt >= 0.2.6557 not found using pkg-config
It seems that the problem starts at port mpg123
, not libopenmpt
.
Package: ffmpeg[all,all-gpl,all-nonfree,amf,aom,ass,avcodec,avdevice,avfilter,avformat,bzip2,core,dav1d,fdk-aac,ffmpeg,ffplay,ffprobe,fontconfig,freetype,fribidi,gpl,iconv,ilbc,lzma,modplug,mp3lame,nonfree,nvcodec,opencl,opengl,openh264,openjpeg,openmpt,openssl,opus,postproc,qsv,sdl2,snappy,soxr,speex,srt,ssh,swresample,swscale,theora,vorbis,vpx,webp,x264,x265,xml2,zlib]:x64-windows-static -> 5.1.2#4
Host Environment
To Reproduce
vcpkg install ffmpeg[all-nonfree,ffmpeg,ffprobe,ffplay]:x64-windows-static
Workaround
A "workaround" for building
ffmpeg
is to removeopenmpt
from ffmpeg dependencies.Failure
This sounds to be the main/base issue (more info in the log above) while building ffmpeg:
Failure logs
E:\d\ffmpeg\build-x64-windows-static-rel-config.log
``` # /e/d/ffmpeg/src/n5.1.2-f31542651f.clean/configure --prefix=/e/vc/packages/ffmpeg_x64-windows-static --toolchain=msvc --enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect --disable-autodetect --pkg-config='E:/vc/installed/x64-windows/tools/pkgconf/pkgconf.exe' --target-os=win32 --enable-w32threads --enable-d3d11va --enable-dxva2 --enable-mediafoundation --disable-inline-asm --cc=cl.exe --cxx=cl.exe --windres=rc.exe --ld=link.exe --ar='ar-lib lib.exe' --enable-nonfree --enable-gpl --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-avcodec --enable-avdevice --enable-avformat --enable-avfilter --enable-postproc --enable-swresample --enable-swscale --disable-alsa --enable-amf --enable-libaom --enable-libass --disable-avisynth --enable-bzlib --enable-libdav1d --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-iconv --enable-libilbc --enable-lzma --enable-libmp3lame --enable-libmodplug --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid --enable-ffnvcodec --enable-opencl --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-openssl --enable-libopus --enable-sdl2 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --disable-libtensorflow --disable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-zlib --enable-libsrt --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv --enable-cross-compile --extra-cflags='-DHAVE_UNISTD_H=0' --pkg-config-flags=--static --enable-optimizations --arch=x86_64 --enable-asm --enable-x86asm ALLUSERSPROFILE='C:\ProgramData' ALL_COMPONENTS=' aac_adtstoasc_bsf av1_frame_merge_bsf av1_frame_split_bsf av1_metadata_bsf chomp_bsf dump_extradata_bsf dca_core_bsf dv_error_marker_bsf eac3_core_bsf extract_extradata_bsf filter_units_bsf h264_metadata_bsf h264_mp4toannexb_bsf h264_redundant_pps_bsf hapqa_extract_bsf hevc_metadata_bsf hevc_mp4toannexb_bsf imx_dump_header_bsf mjpeg2jpeg_bsf mjpega_dump_header_bsf mp3_header_decompress_bsf mpeg2_metadata_bsf mpeg4_unpack_bframes_bsf mov2textsub_bsf noise_bsf null_bsf opus_metadata_bsf pcm_rechunk_bsf pgs_frame_merge_bsf prores_metadata_bsf remove_extradata_bsf setts_bsf text2movsub_bsf trace_headers_bsf truehd_core_bsf vp9_metadata_bsf vp9_raw_reorder_bsf vp9_superframe_bsf vp9_superframe_split_bsf aasc_decoder aic_decoder alias_pix_decoder agm_decoder amv_decoder anm_decoder ansi_decoder apng_decoder arbc_decoder argo_decoder asv1_decoder asv2_decoder aura_decoder aura2_decoder avrp_decoder avrn_decoder avs_decoder avui_decoder ayuv_decoder bethsoftvid_decoder bfi_decoder bink_decoder bitpacked_decoder bmp_decoder bmv_video_decoder brender_pix_decoder c93_decoder cavs_decoder cdgraphics_decoder cdtoons_decoder cdxl_decoder cfhd_decoder cinepak_decoder clearvideo_decoder cljr_decoder cllc_decoder comfortnoise_decoder cpia_decoder cri_decoder cscd_decoder ... Skipped 18145 lines ... libmp3lame-static.lib(mpglib_interface.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(mpglib_interface.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(encoder.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(encoder.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(id3tag.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(id3tag.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(gain_analysis.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(gain_analysis.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(quantize_pvt.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(quantize_pvt.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(psymodel.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(psymodel.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(VbrTag.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(VbrTag.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(tables.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(tables.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(takehiro.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(takehiro.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(newmdct.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(newmdct.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(quantize.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(quantize.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(reservoir.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(reservoir.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(fft.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(fft.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(vbrquantize.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(vbrquantize.obj)' or at ''; linking object as if no debug info libmp3lame-static.lib(xmm_quantize_sub.obj) : warning LNK4099: PDB '' was not found with 'libmp3lame-static.lib(xmm_quantize_sub.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(interface.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(interface.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(common.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(common.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(tabinit.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(tabinit.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(layer3.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(layer3.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(decode_i386.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(decode_i386.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(layer1.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(layer1.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(layer2.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(layer2.obj)' or at ''; linking object as if no debug info libmpghip-static.lib(dct64_i386.obj) : warning LNK4099: PDB '' was not found with 'libmpghip-static.lib(dct64_i386.obj)' or at ''; linking object as if no debug info require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion check_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion test_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion E:/vc/installed/x64-windows/tools/pkgconf/pkgconf.exe --exists --print-errors openh264 check_func_headers wels/codec_api.h WelsGetCodecVersion -IE:/vc/installed/x64-windows-static/include -LE:/vc/installed/x64-windows-static/lib -lopenh264 -lstdc++ test_ld cc -IE:/vc/installed/x64-windows-static/include -LE:/vc/installed/x64-windows-static/lib -lopenh264 -lstdc++ test_cc -IE:/vc/installed/x64-windows-static/include -libpath:E:/vc/installed/x64-windows-static/lib BEGIN ./ffconf.b4qVxAkc/test.c 1 #includeE:\d\ffmpeg\build-x64-windows-static-rel-out.log
``` BUILD_ARCH=x86_64 OPTION_VARIABLE=OPTIONS_x86_64 === CONFIGURING === ERROR: libopenmpt >= 0.2.6557 not found using pkg-config If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem. ```Additional context