Re: error compiling GTK program



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
.



Relevant Pages

  • Re: error compiling GTK program
    ... pratsadhu wrote: ... I get this particular error while compiling GTK programs: ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.apps)
  • error compiling GTK program
    ... I get this particular error while compiling GTK programs: ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.apps)
  • error compiling GTK program
    ... I get this particular error while compiling GTK programs: ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.apps)
  • Re: error compiling GTK program
    ... I get this particular error while compiling GTK programs: ... collect2: ld returned 1 exit status ... Am using gtk 1.2.8. ...
    (comp.os.linux.development.apps)
  • Re: ???? What exits first, Tcl or the threads?
    ... the extension embeds mozilla in tk widgets. ... mozilla needs GTK to run. ... During shutdown, somebody has to terminate the GTK event loop. ... Yes, but again, the spirit of that exit reform is that exitis the ...
    (comp.lang.tcl)