how can I configure GTK+ 2.24 on Visual Studio 2012? I thought that it will be enough to perform the same steps that were needed to take in order to configure GTK+ 2.24 on Visual Studio 2010 ( How to configure gtk on Visual studio 2010 ).
#include <gtk-2.0\gtk\gtk.h>
int main(int argc, char* argv[])
{
GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_init(&argc, &argv);
gtk_widget_set_usize(window, 300, 200);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
gtk_window_set_title(GTK_WINDOW(window), "GTK+ with VS2010");
gtk_widget_show(window);
gtk_main();
return 0;
}
I was wrong, because even if I was able to build that simple project which was provided in the link mentioned before (I slightly edited it to meet visual studio requirement for C to declare all variables before any action), I was still unable to launch it - the window did not show up and I had to kill my program using Task manager since it consumed 100% of processor time. What is more I was able to build and launch simple window project from here: http://zetcode.com/tutorials/gtktutorial/firstprograms/ .
Code:
#include <gtk/gtk.h>
int main( int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "Center");
gtk_window_set_default_size(GTK_WINDOW(window), 230, 150);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_widget_show(window);
g_signal_connect_swapped(G_OBJECT(window), "destroy",
G_CALLBACK(gtk_main_quit), NULL);
gtk_main();
return 0;
}
And this one ran fine.
Notice the headers : #include <gtk-2.0\gtk\gtk.h>
and #include <gtk/gtk.h>
. The former belongs to gtk+2 while the latter belongs to gtk+1.2.
How can I configure my Visual Studio 2012 so that it could launch gtk+2.24?