[cfe-dev] Recursive includes not functioning?

Reid Kleckner rnk at google.com
Tue Mar 25 13:21:57 PDT 2014


Clang uses the INCLUDE environment variable, which is what MSVC does.
 Otherwise I think it tries to guess, and it will probably guess poorly.
 Is your environment set up the same way that vcvars.bat would set up the
environment for cl.exe?  That's the best way to get the compatible behavior.

In this case, it looks like you have "C:\...\include" in INCLUDE instead of
"C:\...\include\um" and "C:\...\include\shared".


On Tue, Mar 25, 2014 at 12:58 PM, Kim <soldoutseashell at gmail.com> wrote:

> Hi, I'm wondering why clang doesn't seem to be including files recursively:
>
> Windows.h is in C:\Program Files (x86)\Windows Kits\8.1\Include\um and
> clang-cl automatically includes C:\Program Files (x86)\Windows
> Kits\8.1\includes yet Windows.h is not found?
>
> I:\LLVM_BUILD_VC12\Release\bin>clang-cl -v test.cpp /Fotest.o -c
> clang version 3.5.0 (trunk)
> Target: i686-pc-win32
> Thread model: posix
>  "I:\LLVM_BUILD_VC12\Release\bin\clang-cl.exe" -cc1 -triple i686-pc-win32
> -emit-
> obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
> test.cpp -m
> relocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
> -mconstruct
> or-aliases -target-cpu pentium4 -D_MT --dependent-lib=libcmt
> --dependent-lib=old
> names -fno-rtti -fdiagnostics-format msvc -v -coverage-file
> "I:\\LLVM_BUILD_VC12
> \\Release\\bin\\test.o" -resource-dir "I:\\LLVM_BUILD_VC12\\Release\
> \bin\\..\\li
> b\\clang\\3.5.0" -internal-isystem "I:\\LLVM_BUILD_VC12\\Release\
> \bin\\..\\lib\\
> clang\\3.5.0\\include" -internal-isystem "I:\\Microsoft Visual Studio
> 12.0\\VC\\
> include" -internal-isystem "C:\\Program Files (x86)\\Windows
> Kits\\8.1\\\\includ
> e" -std=c++11 -fdeprecated-macro -fdebug-compilation-dir
> "I:\\LLVM_BUILD_VC12\\R
> elease\\bin" -ferror-limit 19 -fmessage-length 80 -mstackrealign
> -fms-extensions
>  -fms-compatibility -fmsc-version=1700 -fdelayed-template-parsing
> -fobjc-runtime
> =gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
> -fcolor-diagnostics
>  -vectorize-slp -o test.o -x c++ test.cpp
> clang -cc1 version 3.5.0 based upon LLVM 3.5.0svn default target
> i686-pc-win32
> #include "..." search starts here:
> #include <...> search starts here:
>  I:\LLVM_BUILD_VC12\Release\bin\..\lib\clang\3.5.0\include
>  I:\Microsoft Visual Studio 12.0\VC\include
>  C:\Program Files (x86)\Windows Kits\8.1\\include
> End of search list.
> test.cpp(1,10) :  fatal error: 'Windows.h' file not found
> #include <Windows.h>
>          ^
> 1 error generated.
>
> I:\LLVM_BUILD_VC12\Release\bin>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140325/6ab7341e/attachment.html>


More information about the cfe-dev mailing list