You are here

GTK+ 3.6.1 for Windows (32-bit)

Again based on the OpenSUSE Factory repository, but with more professionnalism ^^ (enhanced installer, SVG image format support, better repartition between "Runtime" et "Bundle" packages....) here is my work-of-the-day :

GTK+ 3.6.1 for Windows (32-bit)

* Only DLLs and dependencies, for running GTK+ 3 apps :
GTK+-Runtime-3.6.1_(TARNYKO).exe (17.2 Mb)

* For developers ; this one ships MinGW-compatible import libraries (dll.a) :
GTK+-Bundle-3.6.1_(TARNYKO).exe (27.6 Mb)

(EDIT : added Microsoft Visual C++ import libraries - .lib files)


Hi, is it possible to create an installer (or at least a zip file) with all the goodies of the opensuse repository? I once downloaded epdfview and I failed to work on windows since it was trying to found /usr/lib ????? But the libraries seem precious.

Any ideas?

(originally posted by Vasileios Anagn...)

Is it possible to put gtk2 packages in the installer? Maybe a silly question.

(originally posted by Vasileios Anagn...)

Hi Vasileios,

You can aspire the whole repo using wget. Tutorials are available online.

I don't know for epdfview, but OBS builds are automated ; it means they aren't checked by a human and sometimes have these types of quirks (hardcoded paths, etc...). I remember having seen that for other programs. GTK+3 is fortunately safe.

For GTK+2, you don't really need installers of mine, because there are some available here. Or did you want the OpenSuSE versions ? I recommend's over them.

Since your distribution of gtk3 has the dependencies, why duplicate them in an often incompatible way. For example gcc-4.7 is incompatible (maybe not for gtk but possible for gtkmm) and diffrent versions of libraries. I see it as advantageous to include gtk2 also in the distribution since gtk+[23] will have the same dependencies.

(originally posted by Vasileios Anagn...)

OK, I see your point. Will do that when I have time, but needs some testing.
BTW, I'm pretty sure the repo's GTKmm needs GCC 4.7. If you're interested in this matter, come back soon, I'll have a complete build environment with compatible GCC+GTKmm3 available for downloading.

Bonjour tarnyo,
Merci pour tout ce temps accordé à GTK pour windows. Ma question question est pour les versions GTK3 sur ce site. J'aimerais savoir s'il sagit des versions stables ou celles en developpement parce qu'à ce sujet rien n'est indiqué.
J'ai essayé de compiler avec GTK+3.4.2 que j'ai pris sur ce site et je me suis rendu compte d'une erreur: "GMenuModel unknow..."
Merci de me repondre.

(originally posted by narcisse)

Bonjour Narcisse,

Elles sont "aussi stables que possible", c'est-à-dire qu'à l'instar de leurs équivalents Linux, l'API évolue régulièrement mais il n'y a pas de problème majeur. Par exemple, ValaWinPKG est développé avec ce même GTK+ 3.4.2 et marche plutôt bien ^^.

Je n'ai jamais rencontré ce message d'erreur, pourrais-tu montrer le morceau de code qui le produit ?

Any chance you can place your work in a public git/bzr/whatever-repo so that other can contribute?

(originally posted by Tom Cato Amundsen)

Hi Tom,

Sure, it's the final target. Actually if you are talking about GTK+3 itself, changes and patches are pushed upstream to GNOME Git (example).
If about the build environment, it's staging here before some things get done, should go to Git soon.
And about the rest (ValaWinPKG a.s.o)... yes I know, been busy lately, will try to do that soon.


Just to let you know : I recently pushed the whole GTK+3 build environment to GNOME git (, so people can now easily grab it and contribute back.

Man, you saved my whole life, now I can build my vala gt3 things on Windows o/

(originally posted by Christian Ferraz)

Haha, cool, glad you found it useful ^^

Hello, is it possible to do static linking with gtk?

(originally posted by max)

Hi max,

On Linux, yes already : read this article.
On win32, it requires more changes to the original source. I'm working on this ; as always "it will be on the site when it's ready" ^^.


Here it is, I released the static libraries for win32. Enjoy !

The official version 3.6.4 for Windows has released. Does this static library have to work with GTK+3.4.2 only? I tried to compile my cpp file with offcial GTK+3.6.4, and link the o file with this static library. It doesn't work.
c:\gtk342_static\lib/libglib-2.0.a(gstrfuncs.o):gstrfuncs.c:(.text+0x1c00): undefined reference to `strcasecmp'
If this is the case, will a static library for the latest version be created and released?
Thanks for your great job!

Hi qlb1234,

Yes, it'll likely fail ; static libraries must be "kept synchronized" as a whole (i.e. you can't mix versions as they could use different symbols).

The main issue here, is that static win32 libraries aren't supported upstream. I unfortunately don't have the time to rebuild all the stuff now. I suppose I could try to push my patches upstream ; I'll get some opinions first, and we will see. Thanks for asking and reminding me of that.

Thank you for your reply.
I probably found a problem. I am using your 3.4.2 static library and MinGW 4.8.1 to build a hello world like C file. I copied and pasted the arguments on
c:\gtk342_static\lib/libglib-2.0.a(gstrfuncs.o):gstrfuncs.c:(.text+0x1c00): undefined reference to `strcasecmp'
c:\gtk342_static\lib/libglib-2.0.a(gstrfuncs.o):gstrfuncs.c:(.text+0x1c21): undefined reference to `strncasecmp'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: c:\gtk342_static\lib/libglib-2.0.a(gstrfuncs.o): bad reloc address 0x200 in section `.rdata'
collect2.exe: error: ld returned 1 exit status
It seems like the gstrfuncs.o is finding two external functions named strcasecmp and strncasecmp which are of POSIX stuff, while they should be stricmp and strnicmp in MSVC due to MinGW won't do that in POSIX way.
If we dig down to gstrfuncs.c in the source code of GTK+, we can see a reference to strcasecmp in line 1847:
1844 g_return_val_if_fail (s1 != NULL, 0);
1845 g_return_val_if_fail (s2 != NULL, 0);
1847 return strcasecmp (s1, s2);
1848 #else
1867 #endif
So I guess, this file is compiled with HAVE_STRCASECMP defined. And the same with HAVE_STRNCASECMP below.
Did I get something wrong? Should this file be compiled with HAVE_STRCASECMP and HAVE_STRNCASECMP undefined to use the functions provided by GTK+ itself? Thank you.

Hello Tarnyko,

First of all, you are doing a great job, thank you very much.

I have a small problem when compiling c++ source with microsoft visual c++ 2010. In line 133 of glibconfig.h G_HAVE_GNUC_VARARGS is defined, but this doesn't work with vc++. Undefining G_HAVE_GNUC_VARARGS solves this problem for me. Maybe glibconfig.h should be updated here...?


Hi tk,
Thanks for pointing that out ! You are right, G_HAVE_GNUC_VARARGS should be defined only when using GCC ; MSVC cannot handle it.

I am looking for a solution now. The bundle is intended to be used with all toolchains. Maybe something like :

#ifdef __GNUC__

could do the trick ? Can you check that with your MSVC install, please ? If it works, I will try to fix it upstream.

Hello Tarnyko,

Yes that works (I have checked it with VC++ 2010), thanks!

I attempted to build 3.6.4 using the build package you provide. Many libraries were successfully built,except the gtk one:

make[2]: Leaving directory `/home/ryan/51_gtk3/gtk+-3.6.4/gtk'
GEN gtkbuiltincache.h
/bin/sh: ./gtk-update-icon-cache: Bad file number
make[1]: *** [gtkbuiltincache.h] Error 126
make[1]: Leaving directory `/home/ryan/51_gtk3/gtk+-3.6.4/gtk'

Hi Ryan,

Did you run the "1d_MSYS-grep.bat" script during initial setup ? And if you did, did it look successful ?
To verify, please type "grep --version". It should display "grep 2.5.4", and not an older version.

Hi Tarnyko,

I face the same issue than Ryan, but for v3.10.6: /bin/sh: ./gtk-update-icon-cache: Bad file number
My grep version is 2.5.9, any help appreciated, when the toolchain of 3.10.6, I will try to build 3.15

Hi Max,

Not really sure, but I found this post when googling your issue. Hope it helps.

Hi Max,

You must be doing this in a non-Admin MSYS shell. I've never encountered this problem as I'd been using WinXP all the time.
Long story short, run the build script again with Admin privilege may solve this problem.
Hope this helps.