macOS build fails when linking librist_plugin.la due to missing cJSON symbols
Compiling VLC from this pull: git clone https://code.videolan.org/videolan/vlc.git
against macOS 11.6.5 with XCode 12.1 and am getting the following compile errors. Please advise how to fix:
../extras/package/macosx/build.sh -c
[build] Building VLC for macOS, architecture x86_64 on a x86_64 device
Setting base environment
Using VLC root dir /Users/CT15/temp/VLC/VLC-GIT-MASTER/vlc, build triplet x86_64-apple-darwin20 and host triplet x86_64-apple-darwin20
[build] Checking for python3 ...
Python 3.8.1
[build] Building in "/Users/CT15/temp/VLC/VLC-GIT-MASTER/vlc/build"
[build] Building building tools
You are ready to build VLC and its contribs
Setting contrib environment with minimum macOS version 10.11 and SDK /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
[build] Building contribs
Packages licensing... GPL version 3
Creating makefile...
Bootstrap completed.
Run "make" to start compilation.
Other targets:
* make install same as "make"
* make prebuilt fetch and install prebuilt binaries
* make tools build native tools binaries
* make list list packages
* make fetch fetch required source tarballs
* make fetch-all fetch all source tarballs
* make distclean clean everything and undo bootstrap
* make mostlyclean clean everything except source tarballs
* make clean clean everything
* make package prepare prebuilt packages
* make help show this text
All packages:
a52 alsa aom aribb24 aribb25 asdcplib ass bluray bpg breakpad
caca cargo cddb chromaprint daala dav1d dca decklink dvbpsi dvdcss
dvdnav dvdread ebml faad2 ffi ffmpeg flac fluid fluidlite fontconfig
freetype2 fribidi fxc2 gcrypt gettext glew glib glslang gme gmp
gnutls goom gpg-error gsm harfbuzz iconv jack jpeg kate lame
libarchive libaribcaption libdsm libebur128 libmpeg2 libplacebo
librist libtasn1 libxml2 live555 lua luac mad matroska medialibrary
mfx microdns modplug mpcdec mpg123 mysofa ncurses nettle nfs
nvcodec ogg openjpeg opus orc png projectM protobuf protoc
pthread-stubs pthreads qt qtdeclarative qtgraphicaleffects
qtquickcontrols2 qtsvg rav1e rav1e-vendor regex rnnoise salsa
samplerate schroedinger shout sidplay2 smb2 soxr sparkle spatialaudio
speex speexdsp sqlite srt ssh2 taglib theora tiff tiger tremor
twolame upnp vncclient vorbis vpx vulkan-headers vulkan-loader
wine-headers x262 x264 x26410b x265 xau xcb xcb-proto xorg-macros
xproto zlib zvbi
All native tools:
luac protoc
Distribution-provided packages:
iconv regex
Automatically selected packages:
a52 aom aribb24 asdcplib ass bluray breakpad cddb chromaprint
dav1d dca decklink dvbpsi dvdnav dvdread faad2 ffmpeg flac
fontconfig freetype2 fribidi gcrypt gettext glslang gme goom
harfbuzz kate libarchive libaribcaption libebur128 libmpeg2
libplacebo librist libxml2 live555 lua luac mad matroska medialibrary
modplug mpcdec mpg123 mysofa ncurses nfs ogg opus png protobuf
protoc rav1e rnnoise samplerate schroedinger shout sidplay2 smb2
soxr sparkle spatialaudio speex speexdsp sqlite srt ssh2 taglib
theora twolame upnp vncclient vorbis vorbis vpx x264 x265 zlib
zvbi
Manually deselected packages:
Manually selected packages:
Depended-on packages:
dvdcss ebml gmp gnutls gpg-error gsm jpeg lame nettle openjpeg
orc
To-be-built packages:
a52 aom aribb24 asdcplib ass bluray breakpad cddb chromaprint
dav1d dca decklink dvbpsi dvdcss dvdnav dvdread ebml faad2 ffmpeg
flac fontconfig freetype2 fribidi gcrypt gettext glslang gme gmp
gnutls goom gpg-error gsm harfbuzz jpeg kate lame libarchive
libaribcaption libebur128 libmpeg2 libplacebo librist libxml2
live555 lua luac mad matroska medialibrary modplug mpcdec mpg123
mysofa ncurses nettle nfs ogg openjpeg opus orc png protobuf
protoc rav1e rnnoise samplerate schroedinger shout sidplay2 smb2
soxr sparkle spatialaudio speex speexdsp sqlite srt ssh2 taglib
theora twolame upnp vncclient vorbis vpx x264 x265 zlib zvbi
make: Nothing to be done for `fetch'.
make: `.gettext' is up to date.
make: Nothing to be done for `all'.
Unsetting contrib flags
Setting libVLC flags
[build] Bootstrap-ing configure
[build] Running make -j9
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in compat
make[2]: Nothing to be done for `all'.
Making all in doc
make[2]: Nothing to be done for `all'.
Making all in po
make[2]: Nothing to be done for `all'.
Making all in share
make[2]: Nothing to be done for `all'.
Making all in src
GEN stamp-revision
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
make[3]: Nothing to be done for `all-am'.
Making all in modules
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
CCLD librist_plugin.la
CCLD libvlc_http.la
CCLD libvlc_srtp.la
CCLD libaccess_output_dummy_plugin.la
CCLD libaccess_output_file_plugin.la
CCLD libaccess_output_http_plugin.la
CCLD libaccess_output_livehttp_plugin.la
CC access_output/libaccess_output_shout_plugin_la-shout.lo
CC access_output/libaccess_http_put_plugin_la-http-put.lo
CC access_output/libaccess_output_srt_plugin_la-srt.lo
CC access_output/libaccess_output_rist_plugin_la-rist.lo
/Users/CT15/temp/VLC/VLC-GIT-MASTER/vlc/extras/package/macosx/../../../modules/access_output/srt.c:260:22: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
chunk_size = __MIN( block_BytestreamRemaining( &p_sys->block_stream ),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/CT15/temp/VLC/VLC-GIT-MASTER/vlc/extras/package/macosx/../../../include/vlc_common.h:549:33: note: expanded from macro '__MIN'
# define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
~ ^ ~
CC audio_output/adummy.lo
1 warning generated.
CC audio_output/libafile_plugin_la-file.lo
CC audio_output/amem.lo
CC audio_output/auhal.lo
CC audio_output/coreaudio_common.lo
CC audio_filter/audiobargraph_a.lo
CC audio_filter/chorus_flanger.lo
CC audio_filter/compressor.lo
Undefined symbols for architecture x86_64:
"_cJSON_AddArrayToObject", referenced from:
_rist_receiver_flow_statistics in librist.a(src_stats.c.o)
"_cJSON_AddItemToArray", referenced from:
_rist_receiver_flow_statistics in librist.a(src_stats.c.o)
"_cJSON_AddNumberToObject", referenced from:
_rist_sender_peer_statistics in librist.a(src_stats.c.o)
_rist_receiver_flow_statistics in librist.a(src_stats.c.o)
"_cJSON_AddObjectToObject", referenced from:
_rist_sender_peer_statistics in librist.a(src_stats.c.o)
_rist_receiver_flow_statistics in librist.a(src_stats.c.o)
"_cJSON_AddStringToObject", referenced from:
_rist_sender_peer_statistics in librist.a(src_stats.c.o)
"_cJSON_CreateObject", referenced from:
_rist_sender_peer_statistics in librist.a(src_stats.c.o)
_rist_receiver_flow_statistics in librist.a(src_stats.c.o)
"_cJSON_Delete", referenced from:
_rist_sender_peer_statistics in librist.a(src_stats.c.o)
_rist_receiver_flow_statistics in librist.a(src_stats.c.o)
"_cJSON_PrintUnformatted", referenced from:
_rist_sender_peer_statistics in librist.a(src_stats.c.o)
_rist_receiver_flow_statistics in librist.a(src_stats.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [librist_plugin.la] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Edited by Marvin Scholz