Error when building example "ld: framework not found Cocoa"
Hello,
I am trying to build the "gtksink" example by copying and pasting the code, and using the Cargo.toml below:
[package]
name = "example-rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
gst_gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gtk = { git = "https://github.com/gtk-rs/gtk3-rs.git", optional = true}
gdk = { git = "https://github.com/gtk-rs/gtk3-rs", package = "gdk", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "gio", optional = true }
gst-gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-gl-egl = { package = "gstreamer-gl-egl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-gl-wayland = { package = "gstreamer-gl-wayland", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-gl-x11 = { package = "gstreamer-gl-x11", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-play = { package = "gstreamer-play", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-player = { package = "gstreamer-player", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
ges = { package = "gstreamer-editing-services", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-sdp = { package = "gstreamer-sdp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-rtsp = { package = "gstreamer-rtsp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-rtsp-server = { package = "gstreamer-rtsp-server", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
gst-allocators = { package = "gstreamer-allocators", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", optional = true }
anyhow = "1.0"
derive_more = "0.99.5"
futures = "0.3"
byte-slice-cast = "1"
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"], optional = true }
pango = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
glutin = { version = "0.29", optional = true }
once_cell = "1.0"
image = { version = "0.24", optional = true }
memmap2 = { version = "0.5", optional = true }
memfd = { version = "0.6", optional = true }
uds = { version = "0.2", optional = true }
[target.'cfg(windows)'.dependencies]
windows = { version = "0.43", features=["Win32_Graphics_Direct3D11",
"Win32_Foundation", "Win32_Graphics_Direct3D", "Win32_Graphics_Dxgi",
"Win32_Graphics_Dxgi_Common", "Win32_Graphics_Direct2D",
"Win32_Graphics_Direct2D_Common", "Win32_Graphics_DirectWrite",
"Foundation_Numerics"], optional = true }
[target.'cfg(target_os = "macos")'.dependencies]
#cocoa = "0.24"
core-foundation = "0.9"
[build-dependencies]
gl_generator = { version = "0.14", optional = true }
[features]
default = []
gtksink = ["gtk", "gio"]
gtkvideooverlay = ["gtk", "gdk", "gio"]
gtkvideooverlay-x11 = ["gtkvideooverlay"]
gtkvideooverlay-quartz = ["gtkvideooverlay"]
rtsp-server = ["gst-rtsp-server", "gst-rtsp", "gst-sdp"]
rtsp-server-record = ["gst-rtsp-server", "gst-rtsp", "gio"]
pango-cairo = ["pango", "pangocairo", "cairo-rs"]
overlay-composition = ["pango", "pangocairo", "cairo-rs"]
gl = ["gst-gl", "gl_generator", "glutin"]
gst-gl-x11 = ["dep:gst-gl-x11"]
gst-gl-egl = ["dep:gst-gl-egl"]
gst-gl-wayland = ["dep:gst-gl-wayland"]
allocators = ["gst-allocators", "memmap2", "memfd", "uds"]
# main
[[bin]]
name = "main"
path = "src/main.rs"
# hello_world
[[bin]]
name = "hello_world_1"
path = "src/hello_world/1/main.rs"
[[bin]]
name = "hello_world_2"
path = "src/hello_world/2/main.rs"
[[bin]]
name = "hello_world_3"
path = "src/hello_world/3/main.rs"
[[bin]]
name = "gst_example_1"
path = "src/gst/example_1/main.rs"
[[bin]]
name = "gtksink"
path = "src/gst/gtksink/main.rs"
However, I am seeing this issue:
= note: ld: framework not found Cocoa
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I believe this is an issue with my installation, but I have already uninstalled and reinstalled XCode command line tool
, and same issue. Is there a flag I can set, or a way to proceed?
Thanks in advance!