Re: [gtk-list] tutorial: first chapter



//Using egcs1.0.2, got gtk 0.99.9 I think.
//This is my error:
//bash$ cc -o first first.c
///tmp/cca289461.o: In function `main':
///tmp/cca289461.o(.text+0xf): undefined reference to `gtk_init'
///tmp/cca289461.o(.text+0x19): undefined reference to `gtk_window_new'
///tmp/cca289461.o(.text+0x2a): undefined reference to `gtk_widget_show'
///tmp/cca289461.o(.text+0x32): undefined reference to `gtk_main'
//collect2: ld returned 1 exit status

Well, in the second chapter of the tutorial (which I assume that you meant to 
refer to in the subject), in section 2.2, there is an explanation on how to 
compile stuff using gtk. (Perhaps this explanation should be moved up a bit to 
after the first program?) I quote:

--8<--
To compile use: 

     gcc -Wall -g helloworld.c -o hello_world `gtk-config --cflags` \
         `gtk-config --libs`
--8<--

This will link in, among others, the gtk library, which contains those 
undefined functions.

//I am not very knowlageable in the workings of my compiler so it could be
//user stupidity, but I still need help.

Well, next time read a bit more in the tutorial. :)

Good luck!

Johannes.
--
Do not meddle in the affairs of wizards, 
for you are crunchy and good with ketchup.

<insert funny description here>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]