<div dir="ltr"><div>Hi Luca,</div><div><br></div><div>You need C and C++ library headers.</div><div><br></div><div>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.</div><div><br></div><div>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</div><div><br></div><div>Dmitry.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 18, 2020 at 9:35 AM Luca Ciciriello via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">

<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi all.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
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:</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">clang++ -std=c++17 testcpp.cpp -o test</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">In file included from testcpp.cpp:1:</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">In file included from /usr/local/clang_llvm/bin/../include/c++/v1/iostream:37:</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">In file included from /usr/local/clang_llvm/bin/../include/c++/v1/ios:214:</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">In file included from /usr/local/clang_llvm/bin/../include/c++/v1/iosfwd:95:</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(0,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">/usr/local/clang_llvm/bin/../include/c++/v1/wchar.h:118:15:
</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(255,99,85)">fatal error:
</span><span style="font-variant-ligatures:no-common-ligatures">'wchar.h' file not found</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">#include_next <wchar.h></span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:"Andale Mono";color:rgb(101,255,78);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">              ^~~~~~~~~</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="color:rgb(12,255,0);font-family:"Andale Mono";background-color:rgba(255,255,255,0.9)">1 error generated.</span> </div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I get this error only on macOS and not on Linux. I’ve followed the same procedure on Linux and MacOS</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
On macOS I’ve created the links: </div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<div style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<span style="font-variant-ligatures:no-common-ligatures">ln -s /usr/local/clang_llvm/include/c++ /usr/local/include/c++</span></div>
<div style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(12,255,0);background-color:rgba(255,255,255,0.9)">
<br>
</div>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
but this doesn’t solve the problem. Any idea?</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Best regards</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Luca Ciciriello</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
</div>
</div>

_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>