Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #98643

Re: C newb - third party libs and using and testing suite

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 17:36 -0800
Organization None to speak of
Message-ID <lnr35gwooi.fsf@kst-u.example.com> (permalink)
References (9 earlier) <m%F2A.45496$Cx7.18500@fx11.iad> <ln4m2cy7yc.fsf@kst-u.example.com> <o2fh0t$gjp$1@dont-email.me> <707a6d31-5488-4c7b-b1c3-8abf0d1a016c@googlegroups.com> <o2fkhu$ps5$1@dont-email.me>

Show all headers | View raw


BartC <bc@freeuk.com> writes:
> On 10/12/2016 00:37, jameskuyper@verizon.net wrote:
>> On Friday, December 9, 2016 at 7:09:25 PM UTC-5, Bart wrote:
>
>>> With -L, I've never managed to make it work when there's a problem
>>> finding object files. I've just tested it, put one of two .obj files I
>>> need in library C:\X, specified both .obj files with no path but
>>> followed or preceded by -LC:\X\ (-LC:/X/ or -LC:/x etc), and it can't
>>> find the file that is in X.
>>
>> How is your test relevant to the behavior of the -L option? That
>> option controls where it looks for library files, not object files.
>
> That might explain it then! (Although I may well have had problems with 
> it finding .a files too.)
>
> I'll have to bail out here but I'm not completely sure what .a files 
> are; I've certainly never created them.
>
> (These days I use .so or .dll files as their format is not tied to a 
> compiler and the content can be accessed from any language. Although it 
> it was necessary, I might be able to turn a .a file into .so/.dll.)

That shouldn't be necessary.

A ".a" file is an archive file, a fairly simple container for a
collection of object (".o") files.  They're used for static linking.

A ".so" file is a dynamic library.

At least for GNU binutils ld, if you specify "-lfoo", it will search
for either "libfoo.a" or "libfoo.so".  I think the latter normally
takes precedence.  If it finds "libfoo.so", it will generate
instructions that will cause it to be loaded when you execute
the program (there can also be an appended version number); the
"ldd" command shows you what dynamic libraries a given executable
depends on.  If it finds "libfoo.a", it will link any needed code
from the archive directly into the generated executable.

And, as explained, above, "-L" takes a directory argument and appends
that directory name to the search path used by "-l".

-- 
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


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