LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gtk programming (https://www.linuxquestions.org/questions/programming-9/gtk-programming-335725/)

sharapchi 06-21-2005 08:11 AM

gtk programming
 
hi,
i want to learn gtk programming. i am new as you see.
i have done this code, on gtk site but i cannot compile this can you help me?#include



<gtk/gtk.h>

int main( int argc,
char *argv[] )
{
GtkWidget *window;

gtk_init (&argc, &argv);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);

gtk_main ();

return 0;
}


gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0`

keefaz 06-21-2005 10:40 AM

The code compiles and run perfectly here
(slackware 10.1, gtk2 2.6.7)

What are your error outputs ?

sharapchi 06-21-2005 02:20 PM

outputs
 
sarapci@mekanin:~$ gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0`
base.c:1: error: parse error before '<' token
base.c:8: error: parse error before '&' token
base.c:8: warning: data definition has no type or storage class
base.c:10: error: `GTK_WINDOW_TOPLEVEL' undeclared here (not in a function)
base.c:10: error: initializer element is not constant
base.c:10: warning: data definition has no type or storage class
base.c:11: warning: parameter names (without types) in function declaration
base.c:11: warning: data definition has no type or storage class
base.c:13: warning: data definition has no type or storage class
base.c:15: error: parse error before "return"
sarapci@mekanin:~$

here is outputs. if you can tell me about this you will make me happy

sharapchi 06-21-2005 02:22 PM

sorry i have done this. thanks for all these


All times are GMT -5. The time now is 01:34 AM.