I've tried to setup and configure GTK+ 3.0 in visual studio and run example project (with c code file) as explained here. However, when I compiled the code, I got lot of errors (around 50) and lot of warnings (around 80). I have also tried this solution, but it didn't work.
The errors I got is in the included headers files of GTK, like:
Error 17 error C2054: expected '(' to follow 'inline' c:\gtk\include\glib-2.0\glib\gutils.h
Error 27 error C2082: redefinition of formal parameter 'inline' c:\gtk\include\glib-2.0\glib\gutils.h
Error 28 error C2146: syntax error : missing ',' before identifier 'gint' c:\gtk\include\glib-2.0\glib\gutils.h
and warnings like:Warning 24 warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int c:\gtk\include\glib-2.0\glib\gutils.h
This is the code I have used:
#include <gtk\gtk.h>
int main(int argc, char* argv[])
{
gtk_init(&argc, &argv);
GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
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;
}
Anyone knows why does it happen?
Thanks for helping