ziggtk icon indicating copy to clipboard operation
ziggtk copied to clipboard

Compilation fails under latest zig

Open 1player opened this issue 3 years ago • 0 comments

I've been spending the last 15 minutes trying to figure out why I can't compile, to no avail:

/home/sph/Sandbox/ziggtk/src/manual.zig:3:19: error: use of undeclared identifier 'GtkApplication'
fn activate(app: *GtkApplication, user_data: gpointer) void {
                  ^
/home/sph/Sandbox/ziggtk/src/manual.zig:22:15: error: use of undeclared identifier 'gtk_application_new'
    var app = gtk_application_new("org.gtk.example", .G_APPLICATION_FLAGS_NONE);
              ^
manual...The following command exited with error code 1:
/usr/bin/zig build-exe /home/sph/Sandbox/ziggtk/src/manual.zig -lc -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 --cache-dir /home/sph/Sandbox/ziggtk/zig-cache --global-cache-dir /home/sph/.cache/zig --name manual -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 --enable-cache 

Libraries are installed, in fact I can compile src/main.c using gcc, but I have no idea why zig isn't importing the gtk include file correctly.

EDIT: works with 0.8.1, so I guess I have to read the 0.9.1 release notes to figure out if they've changed some core semantics...

EDIT 2: yeah, this is why: https://github.com/ziglang/zig/issues/9629 — now all gtk identifiers would need to be qualified.

1player avatar May 27 '22 10:05 1player