1. The most reliable official document:
https://developer.gnome.org/gtk3/stable/gtk-building.html
2. Various bugs during the installation process:
(1) Question 1:
base.c:6:1: ERROR: stray '\274' in program
base.c:6:1: ERROR: stray '\233' in program
base.c:7:1: ERROR: expected ' ;' before 'window'
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
^
Solution: This kind of error is not a problem with the program code, but caused by the incorrect encoding format of certain characters (such as spaces, newlines, etc.) in the program. For example, if you mistakenly use the brackets in the Chinese state, you will make an error.
(2) Question 2:
No package 'atk-bridge-2.0' found
Workaround: atk-bridge-2.0 API is provided by at-spi2-atk, not ATK.
(3) Question 3:
No package 'epoxy' found
Solution: install libepoxy-dev
(4) Question 4:
configure: error: *** XInput2 extension not found. Check 'config.log' for more details.
Solution: install libXi-dev
(5) Question 5:
configure: error: Package requirements (libffi >= 3.0.0) were not met:
Solution: yum install libffi-devel
3. Compile the .c file command
gcc base.c -o base `pkg-config --cflags --libs gtk+-3.0`
Check if GTK is installed:
pkg-config --list-all | grep gtk
Check the GTK library version:
pkg-config --modversion gtk+-2.0
pkg-config --modversion gtk+-3.0
4. Configure environment variables
Look at the official documents, otherwise there will be a lot of moths.