[3976] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: lib*.so vs. lib*.a

daemon@ATHENA.MIT.EDU (Brian Murphy)
Mon Nov 11 21:29:53 1996

Date: Mon, 11 Nov 1996 19:27:38 -0700 (MST)
From: Brian Murphy <jmurphy@U.Arizona.EDU>
To: redhat-list@redhat.com
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

>I am using gcc-2.7.2-9 and ld.so-1.7.14-4 under RH 4.0 with all update
>rpms applied.
>
>I'm sure this is a FAQ, but I spent the last half hour searching for
>the answer in the mailing list archives, etc, to no avail.
>
>% gcc -lX11 foo.c
>ld: cannot open -lX11: No such file or directory>
>
>But...
>/usr/X11R6/libX11.a exists
>/usr/X11R6/libX11.so exists
>And /usr/X11R6/lib is in /etc/ld.so.conf (and I've run ldconfig).
>
>Also -- gcc NEVER finds .so libraries. In fact, the man page
>specifically says that -lfoo will ONLY look for libfoo.a, not libfoo.so.
>
>Help!

The -l is an instruction to the linker.  It should be after the filename.
Try compiling like this:

% gcc foo.c -X11

If you have Motif, or other libraries for X, they need to be in a specific
order. (gcc foo.c -lXm -lXt -lX11)

Hope this helps.

-- Brian



--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post