I found the "sublime-build" code some days ago on the stackoverflow, but I can't find it again, so I am attaching the .sublime-build file that works for me.
{
"cmd": ["g++ -o ${file_base_name} ${file} `pkg-config --libs --cflags gtk+-3.0` && ./${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"shell":true
}