On Tue, 3 Nov 1998, Glynn Clements wrote: > > > Static libraries have to be specified *after* the file which uses > them. When a static library is linked, only those functions which are > known to be required are linked in. > > Try putting the -lgtk last. When I try putting it last, again I get tons of error messages like (hundreds of such messages: /usr/src/bs/BUILD/gtk+970925/gdk/gdkwindow.c:1186: undefined reference to `g_free' /usr/src/bs/BUILD/gtk+970925/gdk/gdkwindow.c:1188: undefined reference to `XFree' /usr/lib/libgdk.a(gdkxid.o): In function `gdk_xid_table_insert': /usr/src/bs/BUILD/gtk+970925/gdk/gdkxid.c:33: undefined reference to `g_warning' > > > And when I use > > gcc -o samp -lgtk sample.c > > > > I get a whole lot of error messages some of which are as follows... > > [undefined gdk_* references snipped] > > You also need need libgdk, e.g. > > gcc -o samp -lgtk -lgdk sample.c > this is what is happening [root@localhost /root]# gcc -o samp -lgtk -lgdk sample.c ld: warning: libc.so.5, needed by /usr/i486-linux-libc5/lib/libX11.so.6, may conflict with libc.so.6 /lib/libc.so.5: the `getwd' function is dangerous and should not be used. /lib/libc.so.5: the `gets' function is dangerous and should not be used. /lib/libc.so.5: warning: `siggetmask' is obsolete; `sigprocmask' is best /usr/lib/libgtk.so: undefined reference to `g_slist_free_1' /usr/lib/libgtk.so: undefined reference to `g_list_alloc' /usr/lib/libgtk.so: undefined reference to `g_list_insert' /usr/lib/libgdk.so: undefined reference to `g_hash_table_remove' /usr/lib/libgtk.so: undefined reference to `g_string_hash' /usr/lib/libgtk.so: undefined reference to `g_hash_table_new' /usr/lib/libgtk.so: undefined reference to `g_list_nth' God. I'm scared...well, a typical newbie I guess. But I'm happy that there are helpful people like Glynn in this world! :-) thanks for the help! Aalhad > -- > Glynn Clements <[EMAIL PROTECTED]> >
Re: newbie problem with linker paths
Syslab Sales and Services Pvt Ltd. Tue, 3 Nov 1998 16:37:16 -0500
- Problems when I compile a simple progra... Jorge Castillo López
- Re: Problems when I compile a simp... Glynn Clements
- newbie problem with linker pat... Syslab Sales and Services Pvt Ltd.
- Re: newbie problem with li... Glynn Clements
- Re: newbie problem with li... Syslab Sales and Services Pvt Ltd.
- Re: newbie problem wit... Glynn Clements
- Re: newbie proble... Syslab Sales and Services Pvt Ltd.
- Re: newbie pr... Glynn Clements