Re: error compiling GTK program



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.
HTH,
Tim Keck
.



Relevant Pages

  • 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: 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: Scriptbasic - Compiling the generated C code
    ... compiler), which I have used in the past, tell me that it has a GCC ... a command line similar to Microsoft C. ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.system)