What causes the "undefined reference" error when building GTK applications, and how can it be resolved?