gtk.txt 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Building wxGTK port with Win32 GDK backend
  2. ------------------------------------------
  3. GTK+ widget toolkit has multiple GDK backends and one of them is Win32.
  4. It is a wrapper around Windows API.
  5. See http://www.gtk.org/download/win32.php
  6. These notes don't consider building wxGTK with X11 backend under Windows.
  7. Building steps:
  8. 1. wxGTK/Win32 build is similar to wxMSW one and you should have configured
  9. and be able to build wxWidgets as described in docs/msw/install.txt
  10. 2. wxGTK/Win32 is disabled by default in wxWidgets, you need to enable it
  11. in bakefiles manually. TOOLKIT variable should not be a constantly MSW
  12. for required bakefile formats.
  13. diff build/bakefiles/config.bkl build/bakefiles/config.bkl
  14. --- build/bakefiles/config.bkl
  15. +++ build/bakefiles/config.bkl
  16. @@ -67,9 +67,9 @@
  17. </if>
  18. <!-- We must make TOOLKIT a constant under Windows -->
  19. - <if cond="FORMAT in ['borland','mingw','msvc','watcom', 'msvc6prj', 'msvs2003prj', 'msvs2005prj', 'msvs2008prj']">
  20. + <!--if cond="FORMAT in ['borland','mingw','msvc','watcom', 'msvc6prj', 'msvs2003prj', 'msvs2005prj', 'msvs2008prj']">
  21. <set var="TOOLKIT">MSW</set>
  22. - </if>
  23. + </if-->
  24. </if>
  25. <!--
  26. Regenerate required make/project files:
  27. cd build\bakefiles
  28. bakefile_gen
  29. 3. Download GTK+ for Windows and uncompress files in the directory
  30. without spaces in the name. We suppose later that GTK+/Win32 is
  31. in the C:\gtk directory.
  32. http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+_2.24.10-1_win32.zip
  33. 4. Building
  34. 4.1 If you are using Visual C++ project files you need to setup GTK+ 2 include directories
  35. C:\gtk\lib\include\gtk-2.0
  36. C:\gtk\lib\include\glib-2.0
  37. C:\gtk\lib\include\cairo
  38. C:\gtk\lib\include\pango-1.0
  39. C:\gtk\lib\include\gdk-pixbuf-2.0
  40. C:\gtk\lib\include\atk-1.0
  41. C:\gtk\lib\glib-2.0\include
  42. C:\gtk\lib\gtk-2.0\include
  43. and library directory
  44. C:\gtk\lib\
  45. See http://msdn.microsoft.com/en-us/library/t9az1d21(v=vs.90).aspx
  46. Open solution file in build\msw directory, select "GTK+ Debug" solution
  47. configuration and build the solution. To be sure that everything is as expected
  48. you can build minimal sample.
  49. GTK+ is linked to wxWidgets always as DLL, so C:\gtk\bin directory should be
  50. in %PATH% environment variable before application run.
  51. 4.2 You can also build using nmake:
  52. set INCLUDE=C:\gtk\lib\glib-2.0\include\;C:\gtk\lib\gtk-2.0\include\;C:\gtk\include\cairo\;C:\gtk\include\pango-1.0\;C:\gtk\include\gtk-2.0\;C:\gtk\include\glib-2.0\;C:\gtk\include\gdk-pixbuf-2.0\;C:\gtk\include\atk-1.0\;
  53. set LIB=C:\gtk\lib\;
  54. set PATH=C:\gtk\bin\;%PATH%;
  55. nmake -f makefile.vc "TOOLKIT=GTK" "TOOLKIT_VERSION=2"
  56. or with MinGW:
  57. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\gtk-2.0
  58. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\glib-2.0
  59. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\cairo
  60. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\pango-1.0
  61. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\gdk-pixbuf-2.0
  62. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\include\atk-1.0
  63. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\lib\glib-2.0\include
  64. set CXXFLAGS=%CXXFLAGS% -IC:\gtk\lib\gtk-2.0\include
  65. set CFLAGS=%CXXFLAGS%
  66. set LDFLAGS=%LDFLAGS% -LC:\gtk\lib
  67. set PATH=C:\gtk\bin\;%PATH%;
  68. mingw32-make -f makefile.gcc "TOOLKIT=GTK" "TOOLKIT_VERSION=2"
  69. 5. Now you can use wxGTK/Win32 as wxMSW in your applications.