mercredi 1 avril 2015

How to make gtk work on Visual studio 2010

I am using Windows 8.1 64-bit with Visual studio 2010 Express. How to make this Gtk work in Visual studio?



#include <string.h>
#include <gtk-2.0\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;
}


Build:



1>------ Rebuild All started: Project: basic-tutorial-1, Configuration: Debug x64 ------
1> basic-tutorial-1.c
1>..\..\basic-tutorial-1.c(6): error C2275: 'GtkWidget' : illegal use of this type as an expression
1> C:\gstreamer\gtk2\include\gtk-2.0\gtk/gtkstyle.h(69) : see declaration of 'GtkWidget'
1>..\..\basic-tutorial-1.c(6): error C2065: 'window' : undeclared identifier
1>..\..\basic-tutorial-1.c(7): error C2065: 'window' : undeclared identifier
1>..\..\basic-tutorial-1.c(7): warning C4047: 'function' : 'GtkWidget *' differs in levels of indirection from 'int'
1>..\..\basic-tutorial-1.c(7): warning C4024: 'gtk_widget_set_usize' : different types for formal and actual parameter 1
1>..\..\basic-tutorial-1.c(9): error C2065: 'window' : undeclared identifier
1>..\..\basic-tutorial-1.c(10): error C2065: 'window' : undeclared identifier
1>..\..\basic-tutorial-1.c(12): error C2065: 'window' : undeclared identifier
1>..\..\basic-tutorial-1.c(12): warning C4047: 'function' : 'GtkWidget *' differs in levels of indirection from 'int'
1>..\..\basic-tutorial-1.c(12): warning C4024: 'gtk_widget_show' : different types for formal and actual parameter 1
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Gtk version used: http://ift.tt/1ngVY0H. Also followed step by step from here: http://ift.tt/1IONF71


Aucun commentaire:

Enregistrer un commentaire