[MacPorts] #70223: gtkmm4: Undefined symbols for architecture arm64

MacPorts noreply at macports.org
Fri Jun 14 23:25:22 UTC 2024


#70223: gtkmm4: Undefined symbols for architecture arm64
--------------------------+--------------------
 Reporter:  chaochinyang  |      Owner:  (none)
     Type:  defect        |     Status:  new
 Priority:  Normal        |  Milestone:
Component:  ports         |    Version:  2.9.3
 Keywords:                |       Port:  gtkmm4
--------------------------+--------------------
 I can successfully install gtkmm4 on my M1 MacBook Pro or M2 Mac Pro by
 {{{
 sudo port install gtkmm4
 }}}
 However, when I simply try the example code from
 https://gnome.pages.gitlab.gnome.org/gtkmm-documentation/chapter-
 basics.html:
 {{{
 #include <gtkmm.h>

 class MyWindow : public Gtk::Window
 {
 public:
   MyWindow();
 };

 MyWindow::MyWindow()
 {
   set_title("Basic application");
   set_default_size(200, 200);
 }

 int main(int argc, char* argv[])
 {
   auto app = Gtk::Application::create("org.gtkmm.examples.base");

   return app->make_window_and_run<MyWindow>(argc, argv);
 }
 }}}
 and compile it with
 {{{
 g++ simple.cc -o simple `pkg-config --cflags --libs gtkmm-4.0` -std=c++17
 }}}
 the compiler gives me the linking error:
 {{{
 Undefined symbols for architecture arm64:
 "__ZN3Gtk15ShortcutManager20add_controller_vfuncERKSt10shared_ptrINS_18ShortcutControllerEE",
 referenced from:
       __ZTV8MyWindow in ccihtuA7.o
       __ZTC8MyWindow0_N3Gtk6WindowE in ccihtuA7.o
       __ZTC8MyWindow48_N3Gtk15ShortcutManagerE in ccihtuA7.o
 "__ZN3Gtk15ShortcutManager23remove_controller_vfuncERKSt10shared_ptrINS_18ShortcutControllerEE",
 referenced from:
       __ZTV8MyWindow in ccihtuA7.o
       __ZTC8MyWindow0_N3Gtk6WindowE in ccihtuA7.o
       __ZTC8MyWindow48_N3Gtk15ShortcutManagerE in ccihtuA7.o
   "__ZN3Gtk6Widget14snapshot_vfuncERKSt10shared_ptrINS_8SnapshotEE",
 referenced from:
       __ZTV8MyWindow in ccihtuA7.o
       __ZTC8MyWindow0_N3Gtk6WindowE in ccihtuA7.o
       __ZTC8MyWindow0_N3Gtk6WidgetE in ccihtuA7.o
   "__ZN3Gtk6Widget16on_query_tooltipEiibRKSt10shared_ptrINS_7TooltipEE",
 referenced from:
       __ZTV8MyWindow in ccihtuA7.o
       __ZTC8MyWindow0_N3Gtk6WindowE in ccihtuA7.o
       __ZTC8MyWindow0_N3Gtk6WidgetE in ccihtuA7.o
 ld: symbol(s) not found for architecture arm64
 collect2: error: ld returned 1 exit status
 }}}
 All the flags and libraries from `pkg-config` look ok to me
 {{{
 % pkg-config --cflags --libs gtkmm-4.0 | tr ' ' '\n'
 -I/opt/local/include/gtkmm-4.0
 -I/opt/local/lib/gtkmm-4.0/include
 -I/opt/local/include/pangomm-2.48
 -I/opt/local/lib/pangomm-2.48/include
 -I/opt/local/include/giomm-2.68
 -I/opt/local/lib/giomm-2.68/include
 -I/opt/local/include/glibmm-2.68
 -I/opt/local/lib/glibmm-2.68/include
 -I/opt/local/include/cairomm-1.16
 -I/opt/local/lib/cairomm-1.16/include
 -I/opt/local/include/sigc++-3.0
 -I/opt/local/lib/sigc++-3.0/include
 -I/opt/local/include/gtk-4.0/unix-print
 -I/opt/local/include/gtk-4.0
 -I/opt/local/include/pango-1.0
 -I/opt/local/include/harfbuzz
 -I/opt/local/include/pango-1.0
 -I/opt/local/include/fribidi
 -I/opt/local/include
 -I/opt/local/include/harfbuzz
 -I/opt/local/include
 -I/opt/local/include/gdk-pixbuf-2.0
 -I/opt/local/include
 -I/opt/local/include/cairo
 -I/opt/local/include/pixman-1
 -I/opt/local/include
 -I/opt/local/include/freetype2
 -I/opt/local/include
 -I/opt/local/include/libpng16
 -I/opt/local/include
 -I/opt/local/include/graphene-1.0
 -I/opt/local/lib/graphene-1.0/include
 -I/opt/local/include
 -I/opt/local/include/glib-2.0
 -I/opt/local/lib/glib-2.0/include
 -I/opt/local/include
 -L/opt/local/lib
 -lgtkmm-4.0
 -lpangomm-2.48
 -lgiomm-2.68
 -lglibmm-2.68
 -lcairomm-1.16
 -lsigc-3.0
 -lgtk-4
 -lpangocairo-1.0
 -lpango-1.0
 -lharfbuzz
 -lgdk_pixbuf-2.0
 -lcairo-gobject
 -lcairo
 -lgraphene-1.0
 -lgio-2.0
 -lgobject-2.0
 -lglib-2.0
 -lintl
 }}}
 Maybe `libgtkmm-4.0` is not configured or compiled correctly by the port?

-- 
Ticket URL: <https://trac.macports.org/ticket/70223>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list