Closed altimac closed 3 years ago
Can you verify that all xcframework
bundles are added to the linking flags (LDFLAGS) using -framework
option.
In your case, some of those undefined symbols are defined in fontconfig
but your linking command does not include -framework fontconfig
.
fontconfig.xcframework is correctly added to the list of libraries linked to the test-app binary :
There are so many frameworks, I can't really guarantee they are all linked using the -framework
flag, but at least fontconfig
is :
Ld /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator/MobileFFmpegTest.app/MobileFFmpegTest normal x86_64 (in target 'MobileFFmpegTest' from project 'MobileFFmpegTest') cd /Users/aure/Desktop/manual-frameworks /Users/aure/Downloads/No_Time_Machine_Backups/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios12.1-simulator -isysroot /Users/aure/Downloads/No_Time_Machine_Backups/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk -L/Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator -F/Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator -F/Users/aure/Desktop/manual-frameworks -filelist /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/Objects-normal/x86_64/MobileFFmpegTest.LinkFileList -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/Objects-normal/x86_64/MobileFFmpegTest_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/MobileFFmpegTest.app-Simulated.xcent -framework fontconfig -framework tiff -framework libwebp -liconv -framework libtheoradec -framework libavfilter -framework libvorbisenc -framework libavdevice -framework libhogweed -framework libnettle -framework GameController -framework VideoToolbox -framework CoreMotion -lz -lc++ -lbz2 -Xlinker -dependency_info -Xlinker /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/Objects-normal/x86_64/MobileFFmpegTest_dependency_info.dat -o /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator/MobileFFmpegTest.app/MobileFFmpegTest
note the -framework fontconfig
entry in the too long command above.
Well, in your first post -framework fontconfig
was not there. And Xcode does not truncate linking commands. I shared my opinion based on what I see in your logs. Most developers will make the same comment after seeing that message.
In your second post, -framework fontconfig
is there but not all libraries are included in that linking command. And I'm pretty sure that you don't have undefined symbols errors for fontconfig
in your second command.
Anyway, I don't have anything to add. I saw this error before and this is how I fixed it. If your logs are not complete, too long or it is difficult to for you to validate a few things then I don't have anything to add. Good luck finding the solution.
Yes I have truncated the logs since they are pretty long. At least you pointed me to the beginning of the solution and i'm going to double check each library linking (checking for -framework
The build log still fails on fontconfig
symbols though, despite the linking command correctly contains -framework fontconfig
:
ld: warning: could not create compact unwind for _filter_frame: stack subq instruction is too different from dwarf stack size
Undefined symbols for architecture x86_64:
"_FT_Select_Size", referenced from:
_FcFreeTypeSpacing in fontconfig(fcfreetype.o)
"_FT_Get_Advance", referenced from:
_FcFreeTypeSpacing in fontconfig(fcfreetype.o)
"_FT_Get_First_Char", referenced from:
_FcFreeTypeCharSet in fontconfig(fcfreetype.o)
_FcFreeTypeSpacing in fontconfig(fcfreetype.o)
"_FT_Get_Next_Char", referenced from:
_FcFreeTypeCharSet in fontconfig(fcfreetype.o)
_FcFreeTypeSpacing in fontconfig(fcfreetype.o)
"_FT_Load_Glyph", referenced from:
[...]
Just in case. Do you know of any reason Xcode would not link with all the .xcframework I've added to the project for this target ?
Solution was to ensure Xcode does recursive searching when searching for frameworks : (FRAMEWORK_SEARCH_PATHS build setting) :
If not recursive, probably because .xcframework directories are "deeper" than traditional .framework bundle and add another level of directories (per architecture), Xcode does not traverse directories and can't find the library/framework binaries, but only the top level .xcframework folders. I suggest you add that information to your documentation about importing frameworks (https://github.com/tanersener/mobile-ffmpeg/wiki/Importing-Frameworks) since Xcode does not set the searching of frameworks as recursive by default.
Thanks for having pointed me in the right direction.
Sure, updated the Importing Frameworks
wiki.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi. Thanks for making a more comprehensible version of FFmpeg for iOS. I'm trying to make an iPad version, LGPL only that may run on a Mac too, using Apple Catalyst technology.
Description I'm trying to build the test-app (MobileFFmpegTest app as a Catalyst app)
Expected behavior Following the documentation about importing frameworks (https://github.com/tanersener/mobile-ffmpeg/wiki/Importing-Frameworks) but of course using xcframeworks instead of framework should make the test-app compilable. Or should it compile only if using the "full-gpl" prebuild frameworks ?
Current behavior Does not link :
Screenshots If applicable, add screenshots to help explain your problem.
Logs Ld /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator/MobileFFmpegTest.app/MobileFFmpegTest normal x86_64 (in target 'MobileFFmpegTest' from project 'MobileFFmpegTest') cd /Users/aure/Desktop/manual-frameworks /Users/aure/Downloads/No_Time_Machine_Backups/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios12.1-simulator -isysroot /Users/aure/Downloads/No_Time_Machine_Backups/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk -L/Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator -F/Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator -F/Users/aure/Desktop/manual-frameworks -filelist /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/Objects-normal/x86_64/MobileFFmpegTest.LinkFileList -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/Objects-normal/x86_64/MobileFFmpegTest_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -sectcreate -Xlinker TEXT -Xlinker entitlements -Xlinker /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/MobileFFmpegTest.app-Simulated.xcent -framework tiff -framework libwebp -liconv -framework libtheoradec -framework libavfilter -framework libvorbisenc -framework libavdevice -framework libhogweed -framework libnettle -framework GameController -framework expat -framework libass -framework libavformat -framework libswresample -framework libpng -framework vo-amrwbenc -framework snappy -framework fribidi -framework lame -framework freetype -framework libxml2 -framework twolame -framework mobileffmpeg -framework VideoToolbox -framework gmp -framework libvorbis -framework CoreMotion -lz -framework kvazaar -framework shine -framework opus -framework libwebpmux -framework wavpack -framework libvpx -framework jpeg -lc++ -lbz2 -Xlinker -dependency_info -Xlinker /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Intermediates.noindex/MobileFFmpegTest.build/Debug-iphonesimulator/MobileFFmpegTest.build/Objects-normal/x86_64/MobileFFmpegTest_dependency_info.dat -o /Users/aure/BuildDirectory/MobileFFmpegTest-blajpbahzkowgobssiwzxwyglcxi/Build/Products/Debug-iphonesimulator/MobileFFmpegTest.app/MobileFFmpegTest
ld: warning: could not create compact unwind for _ac3_eac3_probe: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _filter_frame: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _fits_read_packet: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _redspark_read_header: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _ff_rtsp_setup_output_streams: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _rtsp_write_header: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _rtsp_write_packet: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _udp_open: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _ff_make_absolute_url: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _trim_double_dot_url: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for _ff_ape_parse_tag: stack subq instruction is too different from dwarf stack size Undefined symbols for architecture x86_64: "_FcFontSort", referenced from: _get_fallback in libass(ass_fontconfig.o) "_FcPatternAddBool", referenced from: _get_substitutions in libass(ass_fontconfig.o) _get_fallback in libass(ass_fontconfig.o) "_FcCharSetDestroy", referenced from: _destroy in libass(ass_fontconfig.o) "_FcFontSetDestroy", referenced from: _destroy in libass(ass_fontconfig.o) "_FcCharSetHasChar", referenced from: _check_glyph in libass(ass_fontconfig.o) _get_fallback in libass(ass_fontconfig.o) "_FcConfigParseAndLoad", referenced from: _ass_fontconfig_add_provider in libass(ass_fontconfig.o) "_av_vorbis_parse_reset", referenced from: _vorbis_packet in libavformat(oggparsevorbis.o) "_ff_interleaved_ue_golomb_vlc_code", referenced from: _get_interleaved_ue_golomb in libavformat(rtpenc_vc2hq.o) "_ff_interleaved_golomb_vlc_len", referenced from: _get_interleaved_ue_golomb in libavformat(rtpenc_vc2hq.o) "_avpriv_mjpeg_val_ac_chrominance", referenced from: _ff_rtp_send_jpeg in libavformat(rtpenc_jpeg.o) _jpeg_parse_packet in libavformat(rtpdec_jpeg.o) "_avpriv_mjpeg_bits_dc_chrominance", referenced from: _ff_rtp_send_jpeg in libavformat(rtpenc_jpeg.o) _jpeg_parse_packet in libavformat(rtpdec_jpeg.o) "_avpriv_mjpeg_val_ac_luminance", referenced from: _ff_rtp_send_jpeg in libavformat(rtpenc_jpeg.o) _jpeg_parse_packet in libavformat(rtpdec_jpeg.o) "_avpriv_mjpeg_bits_dc_luminance", referenced from: _ff_rtp_send_jpeg in libavformat(rtpenc_jpeg.o) _jpeg_parse_packet in libavformat(rtpdec_jpeg.o) "_avpriv_mjpeg_val_dc", referenced from: _ff_rtp_send_jpeg in libavformat(rtpenc_jpeg.o) _jpeg_parse_packet in libavformat(rtpdec_jpeg.o) "_FcPatternDel", referenced from: _get_fallback in libass(ass_fontconfig.o) "_av_hmac_alloc", referenced from: _ff_rtmp_calc_digest in libavformat(rtmpdigest.o) _ff_srtp_set_crypto in libavformat(srtp.o) "_av_hmac_update", referenced from: _ff_rtmp_calc_digest in libavformat(rtmpdigest.o) _ff_srtp_decrypt in libavformat(srtp.o) _ff_srtp_encrypt in libavformat(srtp.o) "_av_hmac_final", referenced from: _ff_rtmp_calc_digest in libavformat(rtmpdigest.o) _ff_srtp_decrypt in libavformat(srtp.o) _ff_srtp_encrypt in libavformat(srtp.o) "_av_packet_from_data", referenced from: _ff_rtp_finalize_packet in libavformat(rtpdec.o) _qt_rtp_parse_packet in libavformat(rtpdec_qt.o) _rfc4175_finalize_packet in libavformat(rtpdec_rfc4175.o) "_av_aes_ctr_get_iv", referenced from: _mov_cenc_start_packet in libavformat(movenccenc.o) "_av_image_check_sar", referenced from: _dirac_header in libavformat(oggparsedirac.o) "_av_pix_fmt_get_chroma_sub_sample", referenced from: _yuv4_write_packet in libavformat(yuv4mpegenc.o) _ff_isom_get_vpcc_features in libavformat(vpcc.o) "_av_xiphlacing", referenced from: _viv_read_header in libavformat(vividas.o) _vorbis_header in libavformat(oggparsevorbis.o) _xiph_parse_fmtp_pair in libavformat(rtpdec_xiph.o) "_av_expr_count_vars", referenced from: _filter_frame in libavfilter(vf_scale.o) _scale_parse_expr in libavfilter(vf_scale.o) "_sws_setColorspaceDetails", referenced from: _filter_frame in libavfilter(vf_scale.o) "_sws_isSupportedEndiannessConversion", referenced from: _query_formats in libavfilter(vf_scale.o) "_av_frame_set_qp_table", referenced from: _filter_frame in libavfilter(vf_qp.o) "_av_hwdevice_get_hwframe_constraints", referenced from: _hwupload_query_formats in libavfilter(vf_hwupload.o) "_av_hwframe_constraints_free", referenced from: _hwupload_query_formats in libavfilter(vf_hwupload.o) "_av_hwframe_ctx_init", referenced from: _hwmap_config_output in libavfilter(vf_hwmap.o) _hwupload_config_output in libavfilter(vf_hwupload.o) "_av_expr_count_func", referenced from: _geq_init in libavfilter(vf_geq.o) "_av_stereo3d_create_side_data", referenced from: _activate in libavfilter(vf_framepack.o) "_avpriv_init_elbg", referenced from: _filter_frame in libavfilter(vf_elbg.o) "_avpriv_do_elbg", referenced from: _filter_frame in libavfilter(vf_elbg.o) "_av_set_options_string", referenced from: _command in libavfilter(vf_drawtext.o) "_FcPatternGetDouble", referenced from: _init in libavfilter(vf_drawtext.o) "_sws_scale", referenced from: _filter_frame in libavfilter(vf_dnn_processing.o) _scale_slice in libavfilter(vf_scale.o) _filter_frame in libavfilter(vf_sr.o) _output_single_frame in libavfilter(vf_zoompan.o) _ff_scale_image in libavfilter(lswsutils.o) "_av_pixelutils_get_sad_fn", referenced from: _filter_frame in libavfilter(vf_deshake.o) "_av_image_fill_max_pixsteps", referenced from: _config_input in libavfilter(vf_crop.o) _config_props in libavfilter(vf_hflip.o) _config_input_main in libavfilter(vf_overlay.o) _config_input_overlay in libavfilter(vf_overlay.o) _config_input in libavfilter(vf_swaprect.o) _config_props_output in libavfilter(vf_transpose.o) _config_output in libavfilter(vf_untile.o) ... "_av_frame_get_qp_table", referenced from: _filter_frame in libavfilter(vf_codecview.o) _filter_frame in libavfilter(vf_qp.o) "_av_dct_calc", referenced from: _basic_block_filtering in libavfilter(vf_bm3d.o) _final_block_filtering in libavfilter(vf_bm3d.o) "_av_image_copy_plane", referenced from: _filter_frame in libavfilter(vf_extractplanes.o) _activate in libavfilter(vf_alphamerge.o) _amplify_frame in libavfilter(vf_amplify.o) _filter_slice in libavfilter(vf_atadenoise.o) _filter_frame in libavfilter(vf_avgblur.o) _filter_frame in libavfilter(vf_bilateral.o) _blend_copytop_32 in libavfilter(vf_blend.o) ... "_av_frame_new_side_data", referenced from: _addroi_filter_frame in libavfilter(vf_addroi.o) _filter_frame in libavfilter(vf_mestimate.o) "_FcConfigGetFonts", referenced from: _ass_fontconfig_add_provider in libass(ass_fontconfig.o) "_av_frame_new_side_data_from_buf", referenced from: _addroi_filter_frame in libavfilter(vf_addroi.o) "_av_dict_get_string", referenced from: _tee_write_header in libavformat(tee.o) "_av_bsf_list_parse_str", referenced from: _tee_write_header in libavformat(tee.o) "_av_bsf_get_null_filter", referenced from: _tee_write_header in libavformat(tee.o) "_avpriv_dca_sample_rates", referenced from: _spdif_header_dts in libavformat(spdifenc.o) "_av_adts_header_parse", referenced from: _spdif_get_offset_and_codec in libavformat(spdifdec.o) _spdif_header_aac in libavformat(spdifenc.o) "_av_des_init", referenced from: _oma_read_header in libavformat(omadec.o) _rprobe in libavformat(omadec.o) _nprobe in libavformat(omadec.o) _ff_asfcrypt_dec in libavformat(asfcrypt.o) "_ff_golomb_vlc_len", referenced from: _mxf_write_packet in libavformat(mxfenc.o) "_ff_ue_golomb_vlc_code", referenced from: _mxf_write_packet in libavformat(mxfenc.o) "_avpriv_dnxhd_get_hr_frame_size", referenced from: _mxf_write_packet in libavformat(mxfenc.o) "_avpriv_dnxhd_get_interlaced", referenced from: _mxf_write_packet in libavformat(mxfenc.o) "_avpriv_mpa_bitrate_tab", referenced from: _mp3_write_xing in libavformat(mp3enc.o) _find_header_idx in libavformat(nutenc.o) "_av_encryption_info_clone", referenced from: _mov_read_sample_encryption_info in libavformat(mov.o) "_av_dovi_alloc", referenced from: _mov_read_dvcc_dvvc in libavformat(mov.o) _ff_parse_mpeg2_descriptor in libavformat(mpegts.o) "_av_encryption_info_alloc", referenced from: _mov_read_schm in libavformat(mov.o) _mov_read_tenc in libavformat(mov.o) "_av_encryption_init_info_alloc", referenced from: _mov_read_pssh in libavformat(mov.o) "_av_encryption_init_info_get_side_data", referenced from: _mov_read_pssh in libavformat(mov.o) "_av_encryption_init_info_add_side_data", referenced from: _mov_read_pssh in libavformat(mov.o) "_av_encryption_init_info_free", referenced from: _mov_read_pssh in libavformat(mov.o) "_avpriv_ac3_channel_layout_tab", referenced from: _mov_read_dac3 in libavformat(mov.o) _mov_read_dec3 in libavformat(mov.o) "_av_sha_alloc", referenced from: _mov_read_adrm in libavformat(mov.o) "_av_sha_init", referenced from: _mov_read_adrm in libavformat(mov.o) "_av_sha_final", referenced from: _mov_read_adrm in libavformat(mov.o) "_av_aes_ctr_set_random_iv", referenced from: _ff_mov_cenc_init in libavformat(movenccenc.o) "_av_encryption_info_free", referenced from: _mov_read_close in libavformat(mov.o) _mov_read_senc in libavformat(mov.o) _mov_read_sample_encryption_info in libavformat(mov.o) _mov_parse_auxiliary_info in libavformat(mov.o) _mov_free_encryption_index in libavformat(mov.o) "_av_aes_ctr_free", referenced from: _mov_read_close in libavformat(mov.o) _ff_mov_cenc_free in libavformat(movenccenc.o) "_av_encryption_info_add_side_data", referenced from: _mov_read_packet in libavformat(mov.o) "_av_aes_ctr_set_full_iv", referenced from: _mov_read_packet in libavformat(mov.o) "_av_aes_ctr_crypt", referenced from: _mov_read_packet in libavformat(mov.o) _mov_cenc_write_encrypted in libavformat(movenccenc.o) "_av_md5_final", referenced from: _md5_close in libavformat(md5proto.o) _rtmp_parse_result in libavformat(rtmpproto.o) _ff_http_auth_create_response in libavformat(httpauth.o) "_av_md5_update", referenced from: _md5_write in libavformat(md5proto.o) _rtmp_parse_result in libavformat(rtmpproto.o) _update_md5_strings in libavformat(httpauth.o) "_av_md5_alloc", referenced from: _md5_open in libavformat(md5proto.o) _rtmp_parse_result in libavformat(rtmpproto.o) _ff_http_auth_create_response in libavformat(httpauth.o) "_av_lzo1x_decode", referenced from: _matroska_decode_buffer in libavformat(matroskadec.o) "_av_buffer_realloc", referenced from: _ebml_parse in libavformat(matroskadec.o) _get_qt_codec in libavformat(matroskadec.o) "_avcodec_chroma_pos_to_enum", referenced from: _matroska_read_header in libavformat(matroskadec.o) "_avcodec_enum_to_chroma_pos", referenced from: _mkv_write_header in libavformat(matroskaenc.o) "_av_hmac_free", referenced from: _ff_rtmp_calc_digest in libavformat(rtmpdigest.o) _ff_srtp_free in libavformat(srtp.o) "_av_q2intfloat", referenced from: _ircam_write_header in libavformat(ircamenc.o) "_av_bprint_init_for_buffer", referenced from: _http_open_cnx in libavformat(http.o) "_FcPatternGetInteger", referenced from: _init in libavfilter(vf_drawtext.o) _ass_fontconfig_add_provider in libass(ass_fontconfig.o) "_av_dirname", referenced from: _hls_init in libavformat(hlsenc.o) _hls_append_segment in libavformat(hlsenc.o) _hls_start in libavformat(hlsenc.o) _validate_name in libavformat(hlsenc.o) _format_name in libavformat(hlsenc.o) "_av_stristart", referenced from: _hls_init in libavformat(hlsenc.o) _has_header in libavformat(http.o) _mpjpeg_read_packet in libavformat(mpjpegdec.o) _ff_rtsp_parse_line in libavformat(rtsp.o) _rtsp_parse_range_npt in libavformat(rtsp.o) _trim_double_dot_url in libavformat(url.o) _ff_http_auth_handle_header in libavformat(httpauth.o)
Environment