LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-21-2005, 08:11 AM   #1
sharapchi
Member
 
Registered: Nov 2004
Location: Turkey
Distribution: slackware
Posts: 119

Rep: Reputation: 15
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`
 
Old 06-21-2005, 10:40 AM   #2
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,614

Rep: Reputation: 136Reputation: 136
The code compiles and run perfectly here
(slackware 10.1, gtk2 2.6.7)

What are your error outputs ?
 
Old 06-21-2005, 02:20 PM   #3
sharapchi
Member
 
Registered: Nov 2004
Location: Turkey
Distribution: slackware
Posts: 119

Original Poster
Rep: Reputation: 15
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
 
Old 06-21-2005, 02:22 PM   #4
sharapchi
Member
 
Registered: Nov 2004
Location: Turkey
Distribution: slackware
Posts: 119

Original Poster
Rep: Reputation: 15
sorry i have done this. thanks for all these
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GTK programming linetnew Programming 1 10-12-2005 11:34 AM
GTK programming exvor Programming 10 07-11-2005 03:59 AM
GTK programming geminigal Programming 1 06-02-2005 03:08 AM
Programming with GTK dfownz Programming 6 07-17-2004 01:50 PM
GTK and programming NSKL Programming 2 01-14-2003 03:30 PM


All times are GMT -5. The time now is 03:02 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration