Headers/Libraries default locations

N

Nimmi Srivastav

I have two questions:

1) What are the default directories in which the compiler looks for
standard header files?
2) What are the default directories in which the linker looks for
standard library files?

Thanks,
Nimmi
 
J

Jeff Schwab

Nimmi said:
1) What are the default directories in which the compiler looks for
standard header files?
2) What are the default directories in which the linker looks for
standard library files?

The answers depend on the compiler and linker in question. Read the
compiler's documentation for details.
 
G

Gordon Burditt

1) What are the default directories in which the compiler looks for
standard header files?

There is no guarantee that there are "standard header files".
Standard headers don't have to be in separate files.
In any case, *THE* compiler (that is, mine) installs where
I told it to when I installed it.
2) What are the default directories in which the linker looks for
standard library files?

There is no guarantee that there are "standard library files".
Libraries don't have to be in separate files.
In any case, *THE* compiler (that is, mine) installs where
I told it to when I installed it.

Gordon L. Burditt
 
B

Bill Seurer

Jeff said:
The answers depend on the compiler and linker in question. Read the
compiler's documentation for details.

And note that there may not even be any header files for standard
includes for C++.
 
D

Dan Pop

In said:
I have two questions:

1) What are the default directories in which the compiler looks for
standard header files?

Either platform specific or compiler specific, or both.
2) What are the default directories in which the linker looks for
standard library files?

Ditto.

In other words, the VMS answer will not be the same as the MVS answer
or the Unix answer or the Windows answer. Yet, you have posted your
question only to platform/compiler neutral newsgroups....

Dan
 
J

Julie

Bill said:
And note that there may not even be any header files for standard
includes for C++.

Just out of curiosity, are you aware of any implementation that doesn't have
file-based standard includes?
 
E

E. Robert Tisdale

Nimmi said:
I have two questions:

1) What are the default directories
in which the compiler looks for standard header files?
2) What are the default directories
in which the linker looks for standard library files?

Type

gcc -v empty.c

at your Linux prompt.
 
K

Karthik

Nimmi said:
I have two questions:

1) What are the default directories in which the compiler looks for
standard header files?
This is without an iota of doubt, dependent on the compiler/
platform. Please ask compiler specific newsgroups.
gcc specific newsgroups or
microsoft specific newsgroups should get you more.
2) What are the default directories in which the linker looks for
standard library files?

See my answer for the prev. question.
 
M

Michael Wojcik

Just out of curiosity, are you aware of any implementation that doesn't have
file-based standard includes?

I'm not sure what the definition of "file-based" is, but IBM's various
C compilers for OS/400 put the standard headers in OS/400 IFS source
members. Source members are grouped into files, which reside in
libraries; thus all of the standard headers are in a single file in
these implementations.

Not all operating systems use Unix-like hierarchical file systems, so
questions like "what directory contains the header files" are not
always well-defined. Of course, if your definition of "file" is
sufficiently loose, pretty much any reasonable implementation will
use something "file-based" at some level.

--
Michael Wojcik (e-mail address removed)

"Well, we're not getting a girl," said Marilla, as if poisoning wells were
a purely feminine accomplishment and not to be dreaded in the case of a boy.
-- L. M. Montgomery, _Anne of Green Gables_
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top