[LLVMbugs] [Bug 10074] New: clang++ does not use env. variable CPLUS_INCLUDE_PATH

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 3 05:27:32 PDT 2011


           Summary: clang++ does not use env. variable CPLUS_INCLUDE_PATH
           Product: clang
           Version: 2.9
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: simon at heisterkamp.dk
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

The following little test project compiles with g++ but not with clang++:

File: test/setup.sh:
> export CPLUS_INCLUDE_PATH="$PWD/include"
File test/include/a.h:
> int a=1;
File test/main.cxx:
> #include <iostream>
> #include "sqr.h"
> int main (){ std::cout<<"a="<<a<<std::endl; return 0; }

before sourcing setup.sh, this doens't work.
After sourcing setup.sh this compiles with:
$ g++ main.cxx
$ ./a.out

This fails:
$ clang++ main.cxx 
main.cxx:2:10: fatal error: 'a.h' file not found
#include "a.h"
1 error generated.

The clang man page states that the environment variable CPLUS_INCLUDE_PATH will
be used when looking for includes, but from this test it certainly doesn't look
like that is the case. This is the bug I would like to report.

I noticed this error first with that clang that comes with Xcode 4.0
I have tried to install the latest clang 2.9, and got the same error, although
I'm not sure the installation was correct.


Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list