Search code examples
cuser-interfacegtkgtk3

Setting up GTK for C application development on Windows without MYSYS2 or gvsbuild


In order for me to program my application on Windows with GTK, The official website instructs me to install MYSYS2 and then use pacman to install the required files.

  • Why am I unable to simply download the required assets, C and header files by myself and just add them to my C project like I do with my own files?
  • Why do these files need to be installed with some form of package manager like that? Why do I need to "build" this? Is there any workaround to this? How is it that this is impossible without the help of some Linux environment?
  • At the very least, would it be possible to install GTK environment using MYSYS2 and copy just the GTK+ contents somewhere and never have to repeat this again?

As I understand it, currently I would still have to compile the application using a Linux environment for GTK+ to be compiled into the application.


Solution

  • This could be useful https://github.com/Wesley-Chan/GTK-for-Windows.

    There is also Quod Libet's README for Windows development and that could help you.

    However, historically Gtk has not been the most friendly toolkit for cross platform development, so if you need good Windows support I'd suggest you use Qt.

    That said, Gtk has a better license and hopefully with Gtk 4 cross platform support is going to improve.