 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
mattsites
Joined: 03 May 2007 Posts: 2
|
Posted: Thu May 03, 2007 1:03 pm Post subject: Error compiling book example |
|
|
I'm new to GTK, C and just started reading Andrew Krause's new book, and I tried to compile the first helloworld program. I'm using Ubuntu Feisty Fawn and have installed all of the libraries that Andrew talks about. This is the error I'm getting...
gcc: pkg-config --cflags gtk+-2.0: No such file or directory
gcc: pkg-config --libs gtk+-2.0: No such file or directory
helloworld.c:1:21: error: gtk/gtk.h: No such file or directory
helloworld.c: In function ‘main’:
helloworld.c:4: error: ‘GtkWidget’ undeclared (first use in this function)
helloworld.c:4: error: (Each undeclared identifier is reported only once
helloworld.c:4: error: for each function it appears in.)
helloworld.c:4: error: ‘window’ undeclared (first use in this function)
helloworld.c:6: warning: implicit declaration of function ‘gtk_inut’
helloworld.c:8: warning: implicit declaration of function ‘gtk_window_new’
helloworld.c:8: error: ‘GTK_WINDOW_TOPLEVEL’ undeclared (first use in this function)
helloworld.c:9: warning: implicit declaration of function ‘gtk_window_set_title’
helloworld.c:9: warning: implicit declaration of function ‘GTK_WINDOW’
helloworld.c:10: warning: implicit declaration of function ‘gtk_widget_show’
helloworld.c:12: warning: implicit declaration of function ‘gtk_main’
helloworld.c:13: error: ‘return0’ undeclared (first use in this function)
helloworld.c:15: warning: control reaches end of non-void function
I'm using the sample code provided with the book. |
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 428 Location: Portland, OR USA
|
Posted: Thu May 03, 2007 1:34 pm Post subject: |
|
|
If I had to guess, I would say you are missing the back ticks (usually the key which also has the tilde ~ character) around the pkg-config commands. The backtick operator tells the shell to execute the pkg-config command and put it's output in that place. It is NOT a single quote.
I can't post it right here because the backtick poses a security risk and the server won't allow it, but, make sure you type it EXACTLY as it appears in the book, with the exception of the "\" character which is only there to show you that he's breaking the line in the book. You can type it all out in one line. |
|
| Back to top |
|
 |
mattsites
Joined: 03 May 2007 Posts: 2
|
Posted: Thu May 03, 2007 2:25 pm Post subject: |
|
|
| Thanks, you were right. I didn't type in the ticks, I used single quotes. Now its working! |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|