Ref:

Install msys2 and gcc / g++:

https://www.gtk.org/docs/installations/windows

gtkmm-4.0 → https://blog.csdn.net/qq_41437512/article/details/119044720

msys2:

pacman -S mingw-w64-x86_64-gtk3
pacman -S mingw-w64-x86_64-gtkmm3

// later to check
// pacman -S mingw-w64-x86_64-glade3

Linux Setting → .bashrc file

export PATH="/c/msys64/mingw64/bin/:$PATH"
export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig:$PKG_CONFIG_PATH"

Compiling command (gtkmm3.0 in msys2)

Test the gtkmm on the msys64.

// compile command
g++ main.cc -o test -std=c++17 `pkg-config gtkmm-3.0 --cflags --libs`
./test

Simple code:

// File Name: main.cc
#include <gtkmm.h>

int main(int argc, char *argv[])
{
  auto app = Gtk::Application::create(argc, argv, "copyright");

  Gtk::Window window;
  window.set_default_size(200, 200);

  return app->run(window);
}

Demo in msys64

Demo in msys64


CodeBlock Environment Setting

  1. Compiler Setting

    We install gtkmm in Linux. Therefore, the compiler choice on mingw in msys.

    Settings → Compiler → Toolchain executables

    Untitled