cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/18/20:03:29

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: difference between libraries and headers
Date: 18 Nov 1999 16:51:40 -0800
Organization: InterWorld Communications
Lines: 25
Message-ID: <83aeobwbfn.fsf@mercury.st.hmc.edu>
References: <80vhq4$kvc AT hermes DOT acs DOT unt DOT edu> <38335d9f DOT 2707933 AT newsserver DOT cc DOT monash DOT edu DOT au> <81211g$9uu AT hermes DOT acs DOT unt DOT edu>
NNTP-Posting-Host: mercury.st.hmc.edu
X-Trace: nntp1.interworld.net 942972758 38831 134.173.45.219 (19 Nov 1999 00:52:38 GMT)
X-Complaints-To: usenet AT nntp1 DOT interworld DOT net
NNTP-Posting-Date: 19 Nov 1999 00:52:38 GMT
X-Newsreader: Gnus v5.7/Emacs 20.4
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Morpheus" <hall AT cs DOT unt DOT edu> writes:

> Thanks.
> 
> So the library files contain the implementation, I suppose precompiled to
> object code. And the compiler only knows which library files accompany which
> headers for standard stuff? 

It's actually slightly different.  All the standard C functions are
contained in a single library (libc.a), which is linked by default.
(The linker only includes the parts that are actually used.)  So it
doesn't "know" which libraries go with which headers.  (There is a
similar situation for C++.)

> So when I compile a class or some functions or
> whatever to a library, and put them in the link and library paths, I must
> include the header file and compile the program with the library file, both,
> right?

Yes, that's correct.

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019