GTK+ fatal compile errors basic-tutorial-5.c mac M1
Describe your issue
Compile of basic-tutorial-5.c throws compile error. see below
Expected Behavior
expected compile to run correctly per docs. then expect the following per docs:
This tutorial opens a GTK+ window and displays a movie, with accompanying audio. The media is fetched from the Internet, so the window might take a few seconds to appear, depending on your connection speed. The Window has some GTK+ buttons to Pause, Stop and Play the movie, and a slider to show the current position of the stream, which can be dragged to change it. Also, information about the stream is shown on a column at the right edge of the window.
Observed Behavior
error: call to undeclared function 'gdk_quartz_window_get_nsview'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
window_handle = gdk_quartz_window_get_nsview (window);
^
tut5.c:42:19: note: did you mean 'gdk_quartz_window_get_type'?
/opt/homebrew/Cellar/gtk+3/3.24.38/include/gtk-3.0/gdk/quartz/gdkquartzwindow.h:46:11: note: 'gdk_quartz_window_get_type' declared here
GType gdk_quartz_window_get_type (void);
Setup
-
Operating System: macOS Ventura 13.4.1(c)
-
Device: mac mini M1
-
GStreamer Version: 1.22.4
-
Command line: xCode with commandline tools installed version 14.3.1
Steps to reproduce the bug
- set environment for pkg-config
export PKG_CONFIG_PATH=/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig
- use the pkg-config provided by the GStreamer.framework**
export PATH=/Library/Frameworks/GStreamer.framework/Versions/1.0/bin:$PATH
- Compile and link -- note: For ease of work have locally renamed basic-tutorial-5.c to tut5.c.
gcc tut5.c -o tut5 pkg-config --cflags --libs gstreamer-video-1.0 gtk+-3.0 gstreamer-1.0
How reproducible is the bug?
The reproducibility of the bug is Always
Additional Information
-
attempted to change code to reflect suggestion in error -- does not help.
-
Because no object file is generated, I can't run otool against it. However this is what is generated when I compile basic-tutorial-4 (tut4):
% otool -L tut4
tut4:
/opt/homebrew/opt/gstreamer/lib/libgstreamer-1.0.0.dylib (compatibility version 2205.0.0, current version 2205.0.0)
/opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.4.0)
/opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 7601.0.0, current version 7601.4.0)
/opt/homebrew/opt/gettext/lib/libintl.8.dylib (compatibility version 12.0.0, current version 12.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
%
- Additionally, compile throws a warning. Complete compile error & warning here:
% gcc tut5.c -o tut5 `pkg-config --cflags --libs gstreamer-video-1.0 gtk+-3.0 gstreamer-1.0`
tut5.c:42:19: error: call to undeclared function 'gdk_quartz_window_get_nsview'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
window_handle = gdk_quartz_window_get_nsview (window);
^
tut5.c:42:19: note: did you mean 'gdk_quartz_window_get_type'?
/opt/homebrew/Cellar/gtk+3/3.24.38/include/gtk-3.0/gdk/quartz/gdkquartzwindow.h:46:11: note: 'gdk_quartz_window_get_type' declared here
GType gdk_quartz_window_get_type (void);
^
tut5.c:110:3: warning: 'gtk_widget_set_double_buffered' is deprecated [-Wdeprecated-declarations]
gtk_widget_set_double_buffered (video_window, FALSE);
^
/opt/homebrew/Cellar/gtk+3/3.24.38/include/gtk-3.0/gtk/gtkwidget.h:882:1: note: 'gtk_widget_set_double_buffered' has been explicitly marked deprecated here
GDK_DEPRECATED_IN_3_14
^
/opt/homebrew/Cellar/gtk+3/3.24.38/include/gtk-3.0/gdk/gdkversionmacros.h:356:47: note: expanded from macro 'GDK_DEPRECATED_IN_3_14'
# define GDK_DEPRECATED_IN_3_14 GDK_DEPRECATED
^
/opt/homebrew/Cellar/gtk+3/3.24.38/include/gtk-3.0/gdk/gdkversionmacros.h:48:24: note: expanded from macro 'GDK_DEPRECATED'
#define GDK_DEPRECATED G_DEPRECATED _GDK_EXTERN
^
/opt/homebrew/Cellar/glib/2.76.4/include/glib-2.0/glib/gmacros.h:1262:37: note: expanded from macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
^
1 warning and 1 error generated.
%