I created this thread to have a common place to discuss these issues. GTK is a cross-platform non-commercial graphical user interface for C, now there are these snippets here using GTK http://www.daniweb.com/code/snippet744.html and http://www.daniweb.com/code/snippet737.html but i hope that there would be more :)
Maybe the best howto is this http://www.ibiblio.org/apollo/WinGtkHowto.html I though don't recommend using glade. Also, there is an easier way to compile GTK programs:
gcc something.c -o something.exe -std=c89 -Wall `pkg-config gtk+-2.0 --cflags --libs`
It is again because of the braindead nature of many windows things, that the pkg-config part between the backquotes must be last in command line, though in gcc it doesn't suppose to matter where in the command line something is. You can also write a simple makefile:
all:
/mingw/bin/redir -e errors.txt gcc something.c -o something.exe -std=c89 -Wall `pkg-config gtk+-2.0 --cflags --libs`
and then run "make" in the directory where your code is, to compile. There, the redir stuff is just to redirect the errors to errors.txt, you can do without it, but it's useful sometimes. The reason why the msys is necessary, is because of the braindead nature of windows things, as well. It is just that the windows shell cannot anyhow do the simple thing what these backquotes mean, ie to add the output of the command in backquotes, to command line. Instead of msys you may also use z shell http://zsh.dotsrc.org in windows. Other good feature of the bash-like shell is the tab expansion, which is that you can get a full file or directory name after typing only a part of it, by pressing tab.
How to compile GTK programs with IDE-s like dev-c++, would likely be for you to figure out, but dev-c++ has mingw, and once it also had a package system, which may help to install GTK more easily. But without using bash-like shell, at least i never succeeded to use backquotes in the command line. But the thing is really simple, all you need is to add to compiler options or such, everything which
pkg-config gtk+-2.0 --cflags --libs
outputs. And unless you move GTK libraries to some other place, this should work all the time.
If you want to use mingw without dev-c++ or msys, you should add the /mingw/bin directory to the path, changing start > settings > control panel > system > advanced > environment variables > local variables > PATH. The paths there are separated by semicolon. Now when the gcc says "no input files", then your compiler works.
Installing the zip files is really easy. Download all these zip files to your /mingw directory. To do this easier, you may write a list there, and when you have wget, simply run wget -i list in your /mingw directory. Now provided that you have infozip http://www.info-zip.org, you can simply run unzip *.zip in your /mingw directory. I though use 7zip in windows for all kind of archives.
Don't worry about extracting the archives all under the same directory. All that "installing" is really copying, no configuring is done there. Also the mingw installer doesn't do much, it just extracts the archives under the directory you wish. It is also possible to install mingw by downloading separate archives the same way as gtk, these archives are listed in mingw wiki, all you really need is gcc, binutils, and "mingw-runtime", which is the package that contains all the mingw libraries and header files. The only thing which you have to remember, is that all your archives were roughly from the same release, as they otherwise may not well work together. You can safely overwrite the old files by extracting archives of the newer versions, because for the above reasons such overwriting would not damage anything.