Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: C newb - third party libs and using and testing suite |
| Date | 2016-12-09 15:54 -0800 |
| Organization | None to speak of |
| Message-ID | <ln4m2cy7yc.fsf@kst-u.example.com> (permalink) |
| References | (5 earlier) <J1l0A.41448$%J2.7846@fx20.iad> <1373812a-ef07-88fe-0ef1-84dff44fc96f@verizon.net> <F8f1A.282099$8F2.113429@fx42.iad> <o25frm$9re$1@dont-email.me> <m%F2A.45496$Cx7.18500@fx11.iad> |
S390 <s390@tampascanner.info> writes:
> On Mon, 05 Dec 2016 23:48:05 -0500, James Kuyper wrote:
>>> Well, I guess for the forest for the trees I don't see the issue
>
>> Because -ljamlib takes "jamlib", and prefixes it with "lib", and then
>> adds a ".a" suffix. Net result: it's looking for a file named
>> libjamlib.a. Which is fine, if that's the name of the file you want to
>> link to. Since the file you actually want to link to is jamlib.a, that's
>> a bit of a problem.
>
> Like my quoted line above...I hate to belabor this point.. but this like
> some other things in this is really starting to just frost my cake! ;) :)
>
> I am using this as an education to understand this... although its really
> just starting to annoy me and reinforce why I remember why I never liked
> C to start, and trust me I've got axes to grind on things like Python
> with its idiotic spacing rules!
>
> UMMM... where did anything state that -l
>
> looks for /lib/<string>.a I get from that thing I was reading it needs
> appends .a, but where is this prepending of "lib" coming from????
It's documented in the GNU ld manual, among other places (ld is part of
the "binutils" package). If you're using a linker other than the GNU
binutils version, it should be documented in that linker's manual.
Quoting https://sourceware.org/binutils/docs-2.27/ld/Options.html :
-l namespec
--library=namespec
Add the archive or object file specified by namespec to the
list of files to link. This option may be used any number of
times. If namespec is of the form :filename, ld will search
the library path for a file called filename, otherwise it
will search the library path for a file called libnamespec.a.
On systems which support shared libraries, ld may also
search for files other than libnamespec.a. Specifically,
on ELF and SunOS systems, ld will search a directory for a
library called libnamespec.so before searching for one called
libnamespec.a. (By convention, a .so extension indicates a
shared library.) Note that this behavior does not apply to
:filename, which always specifies a file called filename.
Note that if you want to specify an exact file name, you can do so.
The libFOO.a naming convention is a bit odd. No doubt there are
historical reason for it, but I don't recall exactly what they are.
[SNIP]
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-11-27 01:05 +0000
Re: C newb - third party libs and using and testing suite Richard Heathfield <rjh@cpax.org.uk> - 2016-11-27 01:41 +0000
Re: C newb - third party libs and using and testing suite Richard Heathfield <rjh@cpax.org.uk> - 2016-11-27 13:21 +0000
Re: C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-11-28 03:35 +0000
Re: C newb - third party libs and using and testing suite Richard Heathfield <rjh@cpax.org.uk> - 2016-11-28 10:19 +0000
Re: C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-12-02 19:25 +0000
Re: C newb - third party libs and using and testing suite "James R. Kuyper" <jameskuyper@verizon.net> - 2016-12-02 14:44 -0500
Re: C newb - third party libs and using and testing suite BartC <bc@freeuk.com> - 2016-12-02 19:49 +0000
Re: C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-12-04 13:27 +0000
Re: C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-12-02 20:35 +0000
Re: C newb - third party libs and using and testing suite James Kuyper <jameskuyper@verizon.net> - 2016-11-28 09:27 -0500
Re: C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-12-02 20:43 +0000
Re: C newb - third party libs and using and testing suite "James R. Kuyper" <jameskuyper@verizon.net> - 2016-12-02 16:35 -0500
Re: C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-12-05 14:50 +0000
Re: C newb - third party libs and using and testing suite James Kuyper <jameskuyper@verizon.net> - 2016-12-05 23:48 -0500
Re: C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-12-09 22:12 +0000
Re: C newb - third party libs and using and testing suite "James R. Kuyper" <jameskuyper@verizon.net> - 2016-12-09 18:38 -0500
Re: C newb - third party libs and using and testing suite Keith Thompson <kst-u@mib.org> - 2016-12-09 16:34 -0800
Re: C newb - third party libs and using and testing suite Keith Thompson <kst-u@mib.org> - 2016-12-09 15:54 -0800
Re: C newb - third party libs and using and testing suite BartC <bc@freeuk.com> - 2016-12-10 00:09 +0000
Re: C newb - third party libs and using and testing suite jameskuyper@verizon.net - 2016-12-09 16:37 -0800
Re: C newb - third party libs and using and testing suite BartC <bc@freeuk.com> - 2016-12-10 01:09 +0000
Re: C newb - third party libs and using and testing suite jameskuyper@verizon.net - 2016-12-09 17:32 -0800
Re: C newb - third party libs and using and testing suite Keith Thompson <kst-u@mib.org> - 2016-12-09 17:36 -0800
Re: C newb - third party libs and using and testing suite "James R. Kuyper" <jameskuyper@verizon.net> - 2016-11-26 21:14 -0500
Re: C newb - third party libs and using and testing suite Richard Heathfield <rjh@cpax.org.uk> - 2016-11-27 09:21 +0000
Re: C newb - third party libs and using and testing suite "James R. Kuyper" <jameskuyper@verizon.net> - 2016-11-27 10:36 -0500
Re: Part II - C newb - third party libs and using and testing suite S390 <s390@tampascanner.info> - 2016-12-02 21:20 +0000
Re: Part II - C newb - third party libs and using and testing suite "James R. Kuyper" <jameskuyper@verizon.net> - 2016-12-02 16:55 -0500
Re: Part II - C newb - third party libs and using and testing suite Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-12-02 17:14 -0800
Re: Part II - C newb - third party libs and using and testing suite BartC <bc@freeuk.com> - 2016-12-03 13:39 +0000
Re: Part II - C newb - third party libs and using and testing suite BartC <bc@freeuk.com> - 2016-12-03 02:11 +0000
csiph-web