Compile and deploy GTKmm 3.95 on Windows

Hello;

I am working on a project which is a little difficult; It is to compile and deploy GTKmm 3.95 on Windows;

I tried many paths, but until now, there is no hope; I red the readMe file, help file, it looks very simple; but

i begin to make what is mentionned; I find many difficulties.

Any one had previously worked on the topic?

Can any one help me to find the right steps for make the required job?

Thank you in advance!

Hi, Welcome to GNOME Discourse!

I strongly suggest using MSYS2. You have to compile GTK4 first, at the exact version that GTKmm 3.95 was made for. It seems to me that GTKmm 3.95.1 was released for GTK 3.96.0.

thank you.

I don’t think that Msys2 support Gtkmm 3.95 or GTK4.

Can you guide me how compile GTK4?

Yes, it even has a mingw-w64-x86_64-gtk4 package, but still at version 3.94.0; the version we need is 3.96.0. So the first steps are:

  • install MSYS2 and follow the steps outlined in the homepage: https://www.msys2.org

  • install the required build tools: pacman -S git mingw-w64-x86_64-{gcc,pkg-config,meson}.

  • install the dependencies of GTK4 and GTKmm4: pacman -S mingw-w64-x86_64-{glib2,atk,pango,cairo,gdk-pixbuf2,librsvg,graphene,libepoxy,libsigc++3,glibmm,pangomm,atkmm}.

  • install: pacman -S mingw-w64-x86_64-{shared-mime-info,adwaita-icon-theme}.

If you want support for gobject introspection or you want to generate the documentation you also need: mingw-w64-x86_64-{gobject-introspection,gtk-doc}

1 Like

If everything installs correctly you can build GTK 3.96.0 using Meson. Do you want a release build or a debug build?

1 Like

I don’t use Windows, so I can’t really answer the question, but I want to make sure you understand what you’re asking:

  • GTKmm 3.95 is an unstable version of the GTK C++ bindings for GTK 3.9x
  • GTK 3.9x is the unstable, development version of GTK which will lead to GTK4

Unless you’re working on GTK itself, and on the C++ bindings for GTK, my suggestion would be to stick to GTK 3.24 and its related C++ bindings.

1 Like

thank you for your answer, yes i understand what i am asking, my project is to compile Gtkmm3.95.1 and to work on it; so if i compile Gtkmm i will finish my project

Hello, thanks for your answer, i need both;

I am asking too much; I’am sorry;

In fact, My project is to compile Gtkmm and not to work on it; i don’t know how does Gtkmm work; so i made all steps you’ve told me to make; now i don’t know how to test if gtkmm is installed or not; or if GTK+3.96 is compiled or not;

  • I made all steps;
  • I took another path by dowloading code source and compile GTK4 using meson; It works after i’ve desactivated ‘video streaming’ and ‘diff’;

I try know to compile Gtkmm, but a meesage tell me that it do not find Gtk4; i put the path Gtk build in the path environment, but that does not works.

Hello, What do you think I need to do after compiling GTK3.96 for make it seen by the system so I don’t have the message of error that there is no GTK4 when compiling GTKmm3.95.1

I plan to update the mingw-w64-gtk4 package to 3.96.0 very soon. Once I complete the update work I’m going to write here the instructions to build it and create a pacman package for GTK4 3.96.0

1 Like

Here we are! First of all, install a last package that is needed for the media backend:

pacman -S mingw-w64-x86_64-{gstreamer,gst-plugins-good}

Open Start Menu > MSYS2 64bit > MSYS2 MSYS command line shell and launch the following commands:

git clone https://github.com/lb90/MINGW-packages.git --branch update-gtk4
cd MINGW-packages/mingw-w64-gtk4
export MINGW_INSTALLS=mingw64
makepkg-mingw

If everything is ok, at the end you can install the created package with pacman -U mingw-w64-x86_64-gtk4-3.96.0-1-any.pkg.tar.xz

Finally, close the MSYS2 MSYS shell and open the MSYS2 MinGW64 shell (Start Menu > MSYS2 64bit > MSYS2 MinGW 64-bit) and launch a demo: gtk4-demo-application

1 Like

I have edited the post and updated the repo on github. Should you get any error, please restart from scratch - sorry!

1 Like

Hello, I have always this error
modules/media/meson.build:51:2: ERROR: Dependency “gstreamer-player-1.0” not found, tried pkgconfig

Uhm, probably you need gst-plugins-bad as well. But fortunately the official gtk4 package was updated to 3.96.0 in the meantime! So instead of building you can just install it with pacman now:

pacman -Syu
pacman -S mingw-w64-x86_64-gtk4
1 Like

Yes, gstreamer-player-1.0 is in mingw-w64-x86_64-gst-plugins-bad.

1 Like

from the last time, i try to use “mingw-w64-x86_64-gtk4”; but that does not work
error: impossible to find the target : mingw-w64-x86_64-gtk4

Yes, I just tested after your reply, that does work

Now I have gtk4 compiled

1 Like

Allright. Tomorrow I will try to build gtkmm, then

1 Like

Thanks a lot; you have helped me so much.

1 Like