Trying to setup GTK+ 3.0 on Codeblocks Win7. Having some trouble finding exactly how to do this.

The GTK website directs you to msys2. It seems there was once a direct download on the GTK site for an all-in-one Windows bundle that is no longer there.

Having followed the instructions, installed and updated msys2, I see no reference to GTK+, in the installed files or on the mysys website that GTK directs you to.

Its seems very linuxy in terms of being unnecessarily and stupidly unclear to do something that should be simple. Maybe im missing something but should it not be as simple as downloading a zipped folder, extracting and setting up paths?

At this rate id be faster learning C++ and going with Qt.

The question is in the title, I am amazed I am having to ask the question, it seems like one that google should have completely covered but everything I am finding is relating to a download that is no longer available on the GTK website. I can find no info regarding msys2 and GTK+ 3.0.

Thanks in advance.

NOP da CALLNOP da CALL

Free Download Gtk# 2.99.3. And subsequent to a brief and uneventful process, Gtk# runtime as well as the Gtk# assemblies will be placed on your system. The files required to run GTK+ applications on Windows. Download Latest Version gtk2-runtime-2.-10-10-ash.exe (7.9 MB) Get Updates. Ario is a GTK2 client for MPD (Music player daemon). GTK+ for Windows Runtime Environment Installer. This is the last stable version of gtk-2.8. So you don't need to download.

6 Answers

Welcome, Google users from the future! Since I wrote this answer, the GTK+ website now has official installation instructions that cover what I said below but with more details and less pain. Refer to that page instead. The answer below has been kept for historical reasons.

The problem with the GTK+ website is that there is no one to maintain these binary distributions. The previous binary distribution for Windows was for GTK+ 3.6, which was released I believe way back in 2012, if not earlier. The current version is 3.16, and 3.18 is literally days away from being released. MSYS2 is the only supported installation mechanism, and it's updated frequently enough.

That being said, you need to install GTK+ separately if you use the MSYS route; MSYS doesn't come with GTK+ out of the box. Start with

That should give you a list of possible packages to install, including the GTK+ libraries for both 32-bit and 64-bit MinGW. I forget their exact names now.

Once you find the one you want, use

to install it. Then, open the MinGW 32-bit or 64-bit Shell from the Start menu's MSYS folder to begin developing.

If you want a traditional IDE for GTK+ programming, look up GNOME Builder or Anjuta. For a graphical GUI designer, look up Glade.

andlabsandlabs

Hallelujah, I have found the sane non linux version of getting GTK for windows.

Someone was kind enough to upload to dropbox the GTK files, just download and extract. Here is the link for anyone else who bumps into this GTK/msys2 disaster.

These files really ought to be available on the GTK Windows download page, it beggars belief.

Close this thread, viva windows.

NOP da CALLNOP da CALL

I agree GNOME community is being a bit insolent to this point.They made GTK+ installation almost the same as the Linux installation, which is a bit like giving you pepsi in mcdonalds.

The worst is that it is forcing you to use their own crap to the extent that they even tell you what IDE to choose, how you will build your app, what will have in your app.. (Nothing personal, I will actually always prefer Linux, I'm just being unbiased)

Now to be specific, you explicitly mentioned Codeblocks.Do not use code::block's GTK+ Project, it is awfully outdated.You can, of course modify the script or create your own, but it is still goingto slow you down and we, programmers value our time (I think)

The procedure of installing (to this day) GTK3 ver. 3.22.16 on windows 7 for use with Code::Blocks turns out to be pretty simple.First download MSYS2 and type within the msys2 shell:

pacman -S mingw-w64-x86_64-gtk3

(Enter y to confirm)Then

pacman -S mingw-w64-x86_64-toolchain base-devel(to make sure you'll have precompiled binaries of pkg-config and to make sure you will have the latest version of gcc)

Then you have some work in CodeBlocks, firstset the new compiler, from the Codeblocks's compiler settings -> Toolchain executables. The new compiler should be located in C:msys64mingw64(C or the disk you installed MSYS in)

Then link some libraries in Codeblocks's compiler settings -> Search directories:These libraries will be enough to run this simple sample code:

and have a result like this:

EdeniaEdenia

If you're looking for projects who, apart from Msys2, provide up-to-date, MSVC-compatible GTK3 stuff, you should check-out gvsbuild and Microsoft's vcpkg.Under the hood, the former uses python and the later uses cmake.

Download
sgetosgeto

Days ago i send a email to one of the maintainer of gtk for help with vs 2017, and here is the letter. After this , i chose to use gtk 2.0 on windows

This is mine

I installed the msys2, and I noticed that , there are many head fille under this folder .msys64mingw64include So , I’m wondering if I can directly include those file under msys64 to vs 2017. And let vs 2017 to use lib under the folder.like this......

and this is from him

First off, I do not recommend using the msys builds, unless you are sure that-You do not attempt to use FILE structures in your code with the ones used by GLib, etc.-The glibconfig.h that you are using matches the glibcocnfig.h.win32 in the source tarball of the version of GLib you are using, because everything that is built against GLib will be affected by it.

If you still decide to go down this route, you need to specify the libraries when you link. See Linker->Input->Additional Dependencies, you will need at least the following .lib files, separated by semicolons:

gtk-3.0.lib (or gtk-3.lib)

gdk-3.0.lib (or gdk-3.lib)

gdk_pixbuf-2.0.lib

pangocairo-1.0.lib

pango-1.0.lib

Download Gtk For Windows

atk-1.0.lib

gio-2.0.lib

gobject-2.0.lib

gmodule-2.0.lib

glib-2.0.lib

cairo-gobject.lib

cairo.lib

intl.lib

and possibly fontconfig.lib and freetype.lib, as probably the msys64 builds include support for them.

You will also need to link to any other libraries that you may use for your assignment. Prepend these libraries with a trailing ; before %(AdditionalDependencies) (don't remove %(AdditionalDependencies))

With blessings, and cheers!

Well...i've spend several days to port my program to windows, after struggle with gtk 3.x, i found that you may use gtk 2.x to avoid all those trouble. These are some old file called All-in-one bundlealthough it is important to know that , there is some security issue with it,(plus you need to rewrite it to gtk 2.0)but if you are mainly using linux ,and just wanna it to run on windows , i'll suggest you to use old All-in-one bundle for gtk 2.xfor example

Z-Y00Z-Y00

Hello there is a msi package of Gtk3 for Windows here: (gtk-runtime-3.8.1-i686) https://sourceforge.net/projects/gtk3win/

DingoNobruDingoNobru

Not the answer you're looking for? Browse other questions tagged cwindowsgtkcodeblocksgtk3 or ask your own question.

This entry was posted on 5/15/2019.