标签:
You should always ship all needed DLLs & files with your binaries. End-users should not be required to download the bundle themselves.
GTK+3 is known to work on Windows XP, Vista, 7 and 8 at this date.
Developers might want to have a working MinGW or MSVC installation.
Download the latest all-in-one bundle and extract it using right-click -> "Extract All...". Choose a location at your will ; we will call it %GTKDIR% during next phases.
Add %GTKDIR%\bin to your PATH environment variable :
Click on "Advanced tab" -> "Environment variables". Double-click on PATH line in "System variables" panel, and add ;%GTKDIR%\bin at the end of the text.
Optionally, open a console (Start -> Run -> "cmd" or Start -> search for "cmd") and type the following commands :
Let‘s test ! Still in a console or in the "Run" window, run the demo : gtk3-demo
You should have a working installation, i.e. "gcc.exe" already in your PATH.
In the console, verify that "pkg-config" prints out something reasonable by typing :
pkg-config --cflags --libs gtk+-3.0
Use this output in your further compilation commands, like this one :
gcc -o gtk3.exe gtk3.c -mms-bitfields -Ic:/gtk3/include/gtk-3.0 -Ic:/gtk3/include/atk-1.0 -Ic:/gtk3/include/cairo [...]
Test the resulting executable (here gtk3.exe) :
Open the Visual Studio Command Prompt :
In the console, verify that "pkg-config" prints out something reasonable by typing :
pkg-config --cflags gtk+-3.0
Use this output in your further compilation commands, like this one, modifying the following :
For instance :
cl gtk3.c -mms-bitfields -Ic:/gtk3/include/gtk-3.0 -Ic:/gtk3/include/atk-1.0 [...] -Dinline= /link /libpath:c:/gtk3/lib gtk-win32-3.0.lib gobject-2.0.lib
("gtk-win32-3.0.lib gobject-2.0.lib" are a minimal requirement. You may want to add other .lib files as you need them)
Test the resulting executable (here gtk3.exe) :
GTK:Installation and usage tutorial for Windows
标签:
原文地址:http://www.cnblogs.com/faeriesoft/p/4220307.html