[llvm-dev] Build on macOS Catalina

Dmitry Babokin via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 18 10:12:24 PST 2020


Hi Luca,

You need C and C++ library headers.

C headers come as part of macOS SDK. To let compiler know about its
location you need to add -DDEFAULT_SYSROOT=`xcrun --show-sdk-path` to CMake
configuration.

C++ headers come from the toolchain. I.e. they are part of clang
distribution, so you can either link to existing clang location or build
libc++ to your clang build (I think this is better option):
-DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi

Dmitry.

On Tue, Feb 18, 2020 at 9:35 AM Luca Ciciriello via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi all.
>
> I’ve built and installed llvm+clang from git repository on macOS Catalina.
> My problem now is that I get the following error building my cpp file:
>
> clang++ -std=c++17 testcpp.cpp -o test
> In file included from testcpp.cpp:1:
> In file included from
> /usr/local/clang_llvm/bin/../include/c++/v1/iostream:37:
> In file included from /usr/local/clang_llvm/bin/../include/c++/v1/ios:214:
> In file included from
> /usr/local/clang_llvm/bin/../include/c++/v1/iosfwd:95:
> /usr/local/clang_llvm/bin/../include/c++/v1/wchar.h:118:15: fatal error: 'wchar.h'
> file not found
> #include_next <wchar.h>
>               ^~~~~~~~~
> 1 error generated.
>
> I get this error only on macOS and not on Linux. I’ve followed the same
> procedure on Linux and MacOS
>
> On macOS I’ve created the links:
>
> ln -s /usr/local/clang_llvm/include/c++ /usr/local/include/c++
>
> but this doesn’t solve the problem. Any idea?
>
> Best regards
>
> Luca Ciciriello
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200218/04ee7258/attachment.html>


More information about the llvm-dev mailing list