Issue 52842
Summary Failed to compile project with my build of clang++ (macOS)
Labels new issue
Assignees
Reporter rruipinheiro
    Hello,
I'm trying to compile my project with my build of clang++, for some reason I get a lot of compile errors.

My main.cpp file:
```
#include <iostream>

int main() {
  std::cout << "Hello world!" << std::endl;

  return 0;
}
```

If I call clang++ like this:
``` 
./path/bin/clang++ main.cpp -o main 
```
I get this error:

```
In file included from /path/main.cpp:1:
In file included from /usr/local/bin/../include/c++/v1/iostream:37:
In file included from /usr/local/bin/../include/c++/v1/ios:214:
In file included from /usr/local/bin/../include/c++/v1/__locale:15:
In file included from /usr/local/bin/../include/c++/v1/string:519:
In file included from /usr/local/bin/../include/c++/v1/__debug:14:
In file included from /usr/local/bin/../include/c++/v1/iosfwd:98:
/usr/local/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
              ^~~~~~~~~
```

If I call clang and add the headers like this:

``` 
./path/bin/clang++ main.cpp -o main -I /Library/Developer/CommandLineTools/usr/include/c++/v1/
```

I get this error:

```
In file included from /path/main.cpp:1:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:37:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:214:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iosfwd:95:
/Library/Developer/CommandLineTools/usr/include/c++/v1/wchar.h:136:77: error: use of undeclared identifier 'wcschr'
wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcschr(__s, __c);}
                                                                            ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/wchar.h:143:87: error: use of undeclared identifier 'wcspbrk'
wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcspbrk(__s1, __s2);}
                                                                                      ^
.........
```

I already try to add other header paths and compile flags like: `-std=c++11` and `-stdlib=libc++` but nothing seems to work...
Thanks!

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to