Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build GTK with Windows SDK

how can I compile gtk (itself) with Windows SDK ?

like image 673
bernedef Avatar asked Jun 05 '10 11:06

bernedef


People also ask

Can GTK be used on Windows?

Applications built using Gtk# will run on many platforms including Linux, Windows and macOS. The Mono packages for Windows include GTK, Gtk# and a native theme to make applications look like native Windows applications.

Can you use GTK with C++?

Language BindingsGTK is written in C but has been designed to support a wide range of languages such as Python, JavaScript, C++, Rust and many more.

How do I compile with GTK?

To compile a GTK application, you need to tell the compiler where to find the GTK header files and libraries. This is done with the pkg-config utility. Deprecated GTK functions are annotated to make the compiler emit warnings when they are used (e.g. with gcc, you need to use the -Wdeprecated-declarations option).


3 Answers

Building in Visual Studio is still quite a lot of work. I've done it, but I don't have reproducible steps for you right now. However, if you have a Linux machine around and are willing to cross-compile I have written up directions on how to build GTK+ for Win32 by cross-compiling.

http://live.gnome.org/Cross%20compiling%20GTK%2B%20for%20Win32

It's also possible to build using MSYS in the command-line on Windows, but that's also a major pain in the ass to get setup. It's also really, really slow. Cross-compiling from Linux is, at a minimum, ten times faster. I'm not 100% sure but it seems to be because if you build using the standard build system then there is a lot of process spawning, which is quite expensive in Win32 compared to Linux.

However, if you want to go this way then install MSYS and pull down the source for glib, atk, cairo, pango, and gtk+.. then try to build using the standard Linux way: 1/ untar the source tarball 2/ in the source's root directory do: ./configure 3/ make

There will undoubtedly be other dependencies that you need to install, such as libpng and libjpeg.

like image 197
bratsche Avatar answered Oct 30 '22 12:10

bratsche


Try the HexChat builds. They use Visual Studio 2010 and come with some prepared scripts and solutions to make your life much easier. Oh and you get binary downloads as well.

http://gtk.hexchat.org/

like image 39
bviktor Avatar answered Oct 30 '22 13:10

bviktor


GTK can be compiled under Cygwin or Microsoft Visual C++.

Did you try this installation method? Look the Microsoft Windows section...

Hope it helps!

like image 1
mosg Avatar answered Oct 30 '22 13:10

mosg