I mainly refer to the method of this post.
Http://www.cnblogs.com/PlayMoreSite/archive/2008/10/01/1302990.html
However, you do not need to install third-party software to obtain the Runtime Library. Otherwise, database versions may be inconsistent.ProgramCannot run
Download the required Runtime Library and Development headers and Lib library from the URL below
Http://www.gtk.org/download/win32.php
Download the run-time and Dev packages under GTK + individual packages and required third party dependencies.
Decompress all these packages to the specified directory. After the package is decompressed, it should be as follows:
Add the bin directory to the path environment variable.
Then include the header file and Lib library directory in VC (vs2003)
Right-click "Project Properties" and "C/C ++". The general additional include directory contains both the include directory and the following subdirectories.
Right-click "Project Properties", "linker", and add the absolute directory of lib to the general additional library directory.
Add the required Lib in the additional options of the command line, as shown in figure
Then, you need to find glibconfig. h and gdkconfig. h under the glib and GTK subdirectories under the lib directory and put them under the include root directory.
Now you can find an example to run it.
Directly use this example: http://www.huzheng.org/ebook/gtk2-tut/c103.html#SEC-HELLOWORLD
Running effect: