@rpath issues while linking 1.24 on macOS
Describe your issue
I'm observing weird warnings at the linking phase when building my project on Mac with the latest gstreamer 1.24.1 version (https://gstreamer.freedesktop.org/data/pkg/osx/1.24.1/gstreamer-1.0-1.24.1-universal.pkg and https://gstreamer.freedesktop.org/data/pkg/osx/1.24.1/gstreamer-1.0-devel-1.24.1-universal.pkg). All good with 1.22 (https://gstreamer.freedesktop.org/data/pkg/osx/1.22.11/gstreamer-1.0-1.22.11-universal.pkg and https://gstreamer.freedesktop.org/data/pkg/osx/1.22.11/gstreamer-1.0-devel-1.22.11-universal.pkg):
My approach with 1.22:
export PKG_CONFIG_PATH=/Library/Frameworks/GStreamer.framework_1.22.0/Libraries/pkgconfig/
cmake -S src -B build_122 -G 'Ninja Multi-Config'
cmake --build build_122 --config Release
With 1.24.1:
export PKG_CONFIG_PATH=/Library/Frameworks/GStreamer.framework/Libraries/pkgconfig/
cmake -S src -B build_124 -G 'Ninja Multi-Config'
cmake --build build_124 --config Release
(gst-plugin-scanner:30067): GStreamer-WARNING **: 09:25:21.879: Failed to load plugin '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/libgstopenjpeg.dylib': dlopen(/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/libgstopenjpeg.dylib, 0x0002): Library not loaded: @rpath/@rpath/lib/libopenjp2.7.dylib
Referenced from: <18430B33-5528-30FA-9FC4-B158B55FC7AE> /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/libgstopenjpeg.dylib
Reason: tried: './@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/../../@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/../lib/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/lib/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/../@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/@rpath/lib/libopenjp2.7.dylib' (no such file), './@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/../../@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/../lib/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/lib/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/../@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/@rpath/lib/libopenjp2.7.dylib' (no such file), './@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/../@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/../lib/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/lib/@rpath/lib/libopenjp2.7.dylib' (no such file), './@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/../../@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/../lib/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/lib/@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/../@rpath/lib/libopenjp2.7.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Versions/1.0/libexec/@rpath/lib/libopenjp2.7.dylib' (no such file)
Additional info:
otool -L /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/libgstopenjpeg.dylib
/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/libgstopenjpeg.dylib (architecture x86_64):
@rpath/libgstopenjpeg.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/lib/libgstcodecparsers-1.0.0.dylib (compatibility version 2402.0.0, current version 2402.0.0)
@rpath/lib/libgstreamer-1.0.0.dylib (compatibility version 2402.0.0, current version 2402.0.0)
@rpath/lib/libgobject-2.0.0.dylib (compatibility version 7401.0.0, current version 7401.4.0)
@rpath/lib/libglib-2.0.0.dylib (compatibility version 7401.0.0, current version 7401.4.0)
@rpath/lib/libgstvideo-1.0.0.dylib (compatibility version 2402.0.0, current version 2402.0.0)
@rpath/@rpath/lib/libopenjp2.7.dylib (compatibility version 7.0.0, current version 2.3.1)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0/libgstopenjpeg.dylib (architecture arm64):
@rpath/libgstopenjpeg.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/lib/libgstcodecparsers-1.0.0.dylib (compatibility version 2402.0.0, current version 2402.0.0)
@rpath/lib/libgstreamer-1.0.0.dylib (compatibility version 2402.0.0, current version 2402.0.0)
@rpath/lib/libgobject-2.0.0.dylib (compatibility version 7401.0.0, current version 7401.4.0)
@rpath/lib/libglib-2.0.0.dylib (compatibility version 7401.0.0, current version 7401.4.0)
@rpath/lib/libgstvideo-1.0.0.dylib (compatibility version 2402.0.0, current version 2402.0.0)
@rpath/@rpath/lib/libopenjp2.7.dylib (compatibility version 7.0.0, current version 2.3.1)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
and:
/Library//Frameworks/GStreamer.framework/Versions/1.0/lib/libopenjp2.7.dylib (architecture x86_64):
@rpath/libopenjp2.2.3.1.dylib (compatibility version 7.0.0, current version 2.3.1)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
/Library//Frameworks/GStreamer.framework/Versions/1.0/lib/libopenjp2.7.dylib (architecture arm64):
@rpath/libopenjp2.2.3.1.dylib (compatibility version 7.0.0, current version 2.3.1)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
Expected Behavior
No warnings and all correctly linked.
Setup
- **Operating System: MacOS M3 **
- Device: Computer
- GStreamer Version: 1.24.1