Re: error compiling GTK program
- From: Micah Cowan <micah@xxxxxxxxxx>
- Date: Tue, 28 Feb 2006 21:37:01 GMT
Tim Keck <timkeck@xxxxxxxxxxxxxx> writes:
pratsadhu wrote:
Hi all
I get this particular error while compiling GTK programs:
i compile with:
-----------------------------------------------------
$ gcc base.c -o base `gtk-config --cflags --libs`
/usr/bin/ld: cannot find -lXi
collect2: ld returned 1 exit status
--------------------------------------------------------
gcc test.c -o test `gnome-config --cflags --libs --gnomeui`
:/usr/bin/ld: cannot find -lSM
collect2: ld returned 1 exit status
--------------------------------------------------------
Am using gtk 1.2.8.
Thankin u all,
prat
You haven't told the linker where to find the X libraries.
On my system,
locate libSM.a
returns:
/usr/X11R6/lib/libSM.a
so I would try something like:
gcc test.c -o test -L/usr/X11R6/lib `gnome-config --cflags
--libs --gnomeui`
or write a makefile that includes the library path explicitly.
This appears to be true. But his real problem is that, if gtk-config
is providing -lXi and -lSM, it should also be automatically providing
-L/usr/X11R6/lib or whatever's appropriate (mine does). Hacking his
build utils to tack on -L/usr/X11R6/lib is patching the symptom, not
the problem.
I recommend the OP make sure that his GTK development package is
installed correctly, and up to date. In particular, that it mates with
his non-dev GTK package...
HTH,
Micah
.
- References:
- error compiling GTK program
- From: pratsadhu
- Re: error compiling GTK program
- From: Tim Keck
- error compiling GTK program
- Prev by Date: Re: Trolltech QT license question
- Next by Date: Re: libc/printf bug
- Previous by thread: Re: error compiling GTK program
- Next by thread: libXft2
- Index(es):
Relevant Pages
|