Beginner difficulty with first tutorial program
- From: Jonathan Hayward <christos jonathan hayward gmail com>
- To: gtk-list gnome org
- Subject: Beginner difficulty with first tutorial program
- Date: Tue, 26 Jul 2005 08:50:22 -0500
I've installed 2.4.9 under FC4, and when something else didn't work,
tried to compile and run the tutorial's sample program. I created
test.c:
#include <gtk/gtk.h>
int main(int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_main();
return 0;
}
Then I compiled it with a Makefile:
CC = gcc
CFLAGS = -c -g -O2 -Wall `pkg-config --cflags gtk+-2.0`
LIBS = -lm `pkg-config --libs gtk+-2.0`
test: test.o
$(CC) test.o $(LIBS) -o test
test.o: test.c
$(CC) $(CFLAGS) test.c
According to the tutorial, this should get a blank
200x200 window. When I ran it, however, it seemed to lag; a backtrace
from gdb indicated that I had [without seeing a window] got past the
code that should start the window, and into the event loop:
Program received signal SIGINT, Interrupt.
0x005cb402 in __kernel_vsyscall ()
(gdb) backtrace
#0 0x005cb402 in __kernel_vsyscall ()
#1 0x00b77cb9 in poll () from /lib/libc.so.6
#2 0x0026a248 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#3 0x0026a6e3 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#4 0x0070c1b5 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5 0x080485aa in main (argc=1, argv=0xbfc52224) at test.c:9
What should I be doing differently?
Thank you,
--
++ Jonathan Hayward,
jonathan hayward pobox com** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at
http://JonathansCorner.com** If you'd like a Google Mail (
gmail.com) account, please tell me!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]