RE: Compoilation error



Hi Michal,

Thanks for the help.  

I have this for:
# gtk-config --libs --cflags
-I/opt/sfw/include/gtk-1.2 -I/opt/sfw/include/glib-1.2 -I/opt/sfw/lib/glib/include -I/usr/openwin/include
-L/opt/sfw/lib -L/usr/openwin/lib -R/usr/openwin/lib -lgtk -lgdk -lgmodule -lglib -ldl -lXext -lX11 -lsocket -lnsl -lm
#    

I think that from here I can see that -lgmodule is not specifiued in the path and when I do a serach for the *.pc
# find / -name "*.pc"
/var/glib-2.2.0/glib-2.0.pc
/var/glib-2.2.0/glib-2.0-uninstalled.pc
/var/glib-2.2.0/gmodule-2.0.pc
/var/glib-2.2.0/gmodule-2.0-uninstalled.pc
/var/glib-2.2.0/gthread-2.0.pc
/var/glib-2.2.0/gthread-2.0-uninstalled.pc
/var/glib-2.2.0/gobject-2.0.pc
/var/glib-2.2.0/gobject-2.0-uninstalled.pc
/usr/local/lib/pkgconfig/glib-2.0.pc
/usr/local/lib/pkgconfig/gobject-2.0.pc
/usr/local/lib/pkgconfig/gmodule-2.0.pc
/usr/local/lib/pkgconfig/gthread-2.0.pc
/opt/sfw/lib/pkgconfig/gdk.pc
/opt/sfw/lib/pkgconfig/gtk+.pc
#
I get this much of *.pc files but if I do a more on the glib or gmodule it says that the ${prefix} is /usr/local which I make a find here and everything seems normal. By the way I am using Solaris 8. The *.pc looks like 
# more /var/glib-2.2.0/gmodule-2.0.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

gmodule_supported=true

Name: GModule
Description: Dynamic module loader for GLib
Requires: glib-2.0
Version: 2.2.0
Libs: -L${libdir}  -lgmodule-2.0 -ldl
Cflags:
#  
# more /var/glib-2.2.0/glib-2.0.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: GLib
Description: C Utility Library
Version: 2.2.0
Libs: -L${libdir} -lglib-2.0
Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include

#  

If I modify this pc files They will be the fixed??

BR,

Joaquin

-----Original Message-----
From: Michal 'Gleba' Ziemski
To: Joaquin Henriquez Alzola (REE); gtk-list gnome org
Sent: 1/28/03 6:50 PM
Subject: Re: Compoilation error

Your linker is not able to find the requirded GTK libs.

Run gtk-config --libs --cflags and check if the paths are correct
(I belive gtk-config is a wrapper to pkg-config for GTK??)
If not you'll have to edit your .pc files (most probably they are
in /usr/lib-pkg-config)

If this seems fine, check your library paths (/etc/ld.so.config - or sth
like that
don't remember for sure right now) and add your gtk lib path if
required.

run ldconfig -v and check if the gtk libs are listed

I hope one of these would let you find a solution.

----- Original Message -----
From: "Joaquin Henriquez Alzola (REE)"
<Joaquin Henriquez-Alzola ree ericsson se>
To: <gtk-list gnome org>
Sent: Tuesday, January 28, 2003 6:22 PM
Subject: Compoilation error


> Hi people,
>
> I have a compilation error when I try to compile this program.
>
> # more gtk2.c
> #include <gtk/gtk.h>
>
> void hello( GtkWidget *widget, gpointer   data )
> {
>     g_print ("Hello World\n");
> }
>
> gint delete_event( GtkWidget *widget, GdkEvent  *event, gpointer
data )
> {
>
>     g_print ("delete event occurred\n");
>     return(TRUE);
> }
> void destroy( GtkWidget *widget, gpointer   data )
> {
>     gtk_main_quit();
> }
> int main( int   argc, char *argv[] )
> {
>     GtkWidget *window;
>     GtkWidget *button;
>
>     gtk_init(&argc, &argv);
>     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
>
>     gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (de
> lete_event), NULL);
>
>     gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC
(destroy
> ), NULL);
>
>     gtk_container_set_border_width (GTK_CONTAINER (window), 10);
>
>     button = gtk_button_new_with_label ("Hello World");
>
>     gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC
(hello),
>  NULL);
>
>     gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (
> gtk_widget_destroy), GTK_OBJECT (window));
>
>     gtk_container_add (GTK_CONTAINER (window), button);
>
>     gtk_widget_show (button);
>
>     gtk_widget_show (window);
>
>     gtk_main ();
>     return(0);
> }
>
>
> I get this message:
>
> # gcc -Wall -g gtk2.c -o gtk `gtk-config --cflags` `gtk-config --libs`
> ld: fatal: library -lgmodule: not found
> ld: fatal: library -lglib: not found
> ld: fatal: File processing errors. No output written to gtk
> collect2: ld returned 1 exit status
> #
>
> What is the matter?? I have installed gnu make and glib, zlib,
pkgconfig.
I don't know what else could be wrong. Can you help please?
>
> BR,
>
> Joaquin
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>



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