Hey there, How do I installer gtk+ under windows and compile using the gcc compiler through command line. (not using IDE, just notepad++). I've been looking at the gtk+ site but don't have clue as to where to start and how to install libraries. What do I download and how do i set the whole thing up?


9 Years
Discussion Span
Last Post by revenge2

Just download the binaries from here, and unzip them into any directory you want. Then in your makefile use -I flag to point to that directory.

sorry but not to sound too newbish but could you please correct me?

gtktest.exe	:	gtktest.o
	gcc -o gtktest.exe main.o -I C:\Documents and Settings\--r.s--\Desktop\gtk+_2.16.6-1_win32

Since the path contains spaces you need to enclose them in quotes. And you will need -L flag to point to the directory that contains the libraries -- *.so or *.a.

Personally, I would put them in a different directory that is much shorter and doesn't contain spaces, such as c:\gtk2

Edited by Ancient Dragon: n/a


hey there, I started over and installed mingw in c:\ then extracted the gtk bundle from www.gtk.org into another folder. After that in command prompt

under C:\gtkbundle\bin I executed the command

pkg-config --cflags --libs gtk+-win32-2.0

and directed the output i got from that into a .bat file.
I also added
start cmd
onto the end of the .bat.

from there onwards i tried compiling a test file by using the .bat file with the following

gcc gtktest.c %VAR%

but i got an error saying "gcc: FLAGS: No such file or directory" and some other messages with regards to the gtktest.c file itself.

what have i done wrong?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.