Installation and usage tutorial for windowsreleasing your program
You should always ship all needed DLLs & files with your binaries. End-users should not being required to download the bundle themselves.
Requirements
Gtk+3 is known to work on Windows XP, Vista, 7 and 8 at this date.
Developers might want to has a working MinGW or MSVC installation.
Initial Setup
Download the latest All-in-one bundle and extract it using right-click "Extract All ...". Choose a location at your would; We'll call it %gtkdir% during next phases.
Add %gtkdir%\bin to your PATH environment variable:
- Windows Xp:right-click on "My computer", "Properties".
- Windows VISTA/7: Right-click on "Computer", "Properties", "Advanced system Settings".
Click on the "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:
- Pango-querymodules >%gtkdir%\etc\pango\pango.modules
- Gdk-pixbuf-query-loaders >%gtkdir%\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache
- gtk-query-immodules-3.0 >%gtkdir%\lib\gtk-3.0\3.0.0\immodules.cache
Let ' s test! Still in a console or in the "Run" window, run the demo: Gtk3-demo
Developing with Gtk+3mingw
You should has a working installation, i.e. "Gcc.exe" already in your PATH.
In the console, verify this "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):
MSVC
-
Open the Visual Studio Command Prompt:
-
In the console, verify that "Pkg-config" Prin TS out something reasonable by typing:
pkg-config--cflags gtk+-3.0
-
Use t His output in your further compilation commands, like this one, modifying the following:
- Delete t He "-mms-bitfields" switch;
- Add the "-dinline=/link/libpath:%gtkdir% gtk-win32-3.0.lib gobject-2.0.lib" switches at the end.
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 "is a minimal requirement. Want to add other. lib files as you need them)
-
Test The resulting executable (here g Tk3.exe ):
Gtk:installation and usage tutorial for Windows