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?

-cheers
rev2

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.

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

can someone please help me?

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

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
set VAR=FLAGS
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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.