You do not invoke correctly gcc. The correct invocation would be:
Code:
gcc -o my_window my_window.cpp `pkg-config --cflags --libs gtk+-2.0`
Then "my_window" will be an executable.
For my installation the code has some mistakes. It is "gtk_main_quit()" and for g_signal_connect the invocation is "g_signal_connect(G_OBJECT(main_window),"destroy",G_CALLBACK(destroy),NULL);" (NULL is the last parameter of g_signal_connect and not the seccond of G_CALLBACK).