Fail to compile gtk3 both in msys2 and cmd

That looks like Windows’ command prompt. Backticks don’t work in cmd.exe! “$( )” also doesn’t work. In cmd.exe, they’re ordinary punctuation characters.

You must go into MSys2, navigate to /g/document/C++C/gtkCode, and enter the command there.