Re: Help with compile.



On Sat, 2002-04-20 at 00:01, Wyatt Greenway wrote:
> Hello, I need help with my compile! Here is my source,
> I am just learning gtk, and I am kinda new to linux. I
> have Linux 7.1, on an i686, I don't know the kernal
> version (I don't even know if this is relevent). But
> any way, I try to compile, and it says,
> 
> [root abc gtk]# gcc `pkg-config --cflags --libs
> gtk+-2.0` -o gtk01 gtk01.c
> 
> /tmp/ccnSlwyn.o: In fuction `main':
> /tmp/ccnSlwyn.o(.text+0x4d): undefined reference to
> `g_signal_connect'
> collect2: ld returned 1 exit status
> 
> Help me please, I don't know how to check, or upgrade
> my glibc packages, because I think this is what the
> problem is.
> 
> 
> 	John
> 
> 
> #include <gtk/gtk.h>
> 
> int main (int argc, char **argv) 
> {
>            GtkWidget *window;
>            GtkWidget *image;   
> 
>            gtk_init (&argc, &argv);
>            window = gtk_window_new
> (GTK_WINDOW_TOPLEVEL);
>            g_signal_connect (G_OBJECT (window),
> "destroy", gtk_main_quit, NULL);
> 
>            image = gtk_image_new_from_file
> ("gnome.gif");
>            gtk_container_add (GTK_CONTAINER (window),
> image);
> 
>            gtk_widget_show_all (window);
>            
>            gtk_main ();
>            
>            return 0;
> }
> 

Your code compiles fine for me as is so the problem most likely is with
your setup. The kernel version shouldn't matter, or the glibc version.
What you need to check is the gtk+/glib installation. If you installed
gtk+-2.0 from rpms did you also install the *-devel.rpm packages?


-- 
Stephen




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