Re: compiler search path for the headers
- From: "Mark Salsbery [MVP]" <MarkSalsbery[MVP]@newsgroup.nospam>
- Date: Wed, 22 Aug 2007 12:52:01 -0700
I've never heard of "include" being automatically appended to the /I paths.
I'm not sure what you mea by "builtin path".
Here's what the docs say about the path search order:
--------------------------------------------------------------------------------------
You can use this option with the Ignore Standard Include Paths (/X (Ignore
Standard Include Paths)) option.
The compiler searches for directories in the following order:
1.. Directories containing the source file.
2.. Directories specified with the /I option, in the order that CL
encounters them.
3.. Directories specified in the INCLUDE environment variable.
--------------------------------------------------------------------------------------
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
<linq936@xxxxxxxxx> wrote in message
news:1187809056.740866.168370@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I always have an impression that for the following semantics:
#include <something> e.g. #include <stdio.h>
Compiler searches it from built-in header search path, on UNIX, it
could be /usr/include, /bin/include.
And for the following semantics:
#include "someting" e.g. #include "mine.h"
Compiler searches it according to the -I command option and the
built-in search path.
But I just encountered a problem, it is Visual C++ compiler, it
seems for #include <> type, it also search for -I path. And it
automatically add "include" to the end of -I path, here is an example:
I have -I c:/repo in VC compiler path and in my C code, I have:
#include <auto_array> while the file actually locates at c:/repo/
include/auto_array, but VC compiler finds it.
Could you confirm 2 things:
1. Compiler searches builtin path and -I command option for both
"#include <>" and "#include "" " type include.
2. Compiler add "include" to the end of each search path named in -I
option.
Here is copy & paste from my compile command:
c:/msvsn2003/vc7/bin/cl.exe -W3 -Tp ../s/TestUtils.c -c -nologo -GR -
MDd -Ob2 -Zi -GX -DDEBUG -DNT -DNO_TCL_STUBS -FdlibTestUtils.pdb -
FplibTestUtils.pch -Ic:/repo -I../i
TestUtils.c
Thanks.
.
- Follow-Ups:
- Re: compiler search path for the headers
- From: linq936
- Re: compiler search path for the headers
- References:
- compiler search path for the headers
- From: linq936
- compiler search path for the headers
- Prev by Date: Re: I'm not quite sure where to post this ...
- Next by Date: Re: compiler search path for the headers
- Previous by thread: compiler search path for the headers
- Next by thread: Re: compiler search path for the headers
- Index(es):
Relevant Pages
|