<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">Note the error is not specific to gcc. Macports clang has the same problem.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> > clang++-mp-8.0 -O3 ./main.cpp </span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">In file included from ./main.cpp:1:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">In file included from /opt/local/libexec/llvm-8.0/bin/../include/c++/v1/iostream:38:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">In file included from /opt/local/libexec/llvm-8.0/bin/../include/c++/v1/ios:215:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">In file included from /opt/local/libexec/llvm-8.0/bin/../include/c++/v1/iosfwd:96:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/opt/local/libexec/llvm-8.0/bin/../include/c++/v1/wchar.h:119:15: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">fatal error: </span><span style="font-variant-ligatures: no-common-ligatures" class="">'wchar.h' file not found</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#include_next <wchar.h></span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(47, 180, 29); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">              ^~~~~~~~~</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85098);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">1 error generated.</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">The issue is both macports clang and gcc rely (by default) on /usr/include being present, and this is no longer present by default with Xcode 11, and even if you previously had it was likely wiped out with the last update.</div><div class=""><br class=""></div><div class="">Note, with 10.14 at least (*) you can add back /usr/include by following the instructions in </div><div class=""><br class=""></div><div class=""><a href="https://apple.stackexchange.com/questions/337940/why-is-usr-include-missing-i-have-xcode-and-command-line-tools-installed-moja" class="">https://apple.stackexchange.com/questions/337940/why-is-usr-include-missing-i-have-xcode-and-command-line-tools-installed-moja</a></div><div class=""><br class=""></div><div class="">or, as you say below, explicitly giving the include path in some way, such as the suggestion below.</div><div class=""><br class=""></div><div class="">cheers Chris</div><div class=""><br class=""></div><div class="">(*) The package to add back /usr/include currently does not exist in 10.15 beta, so unless it reappears come final release this is going to be more of a problem thereā€¦.</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 24 Sep 2019, at 7:09 am, Joshua Root <<a href="mailto:jmr@macports.org" class="">jmr@macports.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 2019-9-24 15:31 , Mihir Luthra wrote:<br class=""><blockquote type="cite" class="">Hi,<br class=""><br class="">After the xcode update, there have been many question on stackoverflow<br class="">regarding gcc and g++ linking fails. Any ideas on what can be done?<br class=""><br class=""><a href="https://stackoverflow.com/questions/58072318/cannot-link-any-c-program-with-gcc-on-mac-mojave" class="">https://stackoverflow.com/questions/58072318/cannot-link-any-c-program-with-gcc-on-mac-mojave</a><br class=""><br class="">https://stackoverflow.com/questions/58073301/linker-error-when-trying-to-use-lzma-in-boostiostreams-from-macports<br class=""><br class="">https://stackoverflow.com/questions/58071057/macports-g-fails-to-find-headers-after-recent-xcode-update<br class=""><br class="">Mihir<br class=""></blockquote><br class="">Does passing -isysroot`xcrun --show-sdk-path` to the compiler not work?<br class=""><br class="">While that should make it find headers again, I don't know how many bugs<br class="">it will uncover. I'm not sure how we would make this work out of the box<br class="">for everyone, since AIUI, gcc needs to apply different fixups to the<br class="">system headers depending on the SDK version and does so at build time.<br class="">So Apple taking away not only the SDK corresponding to the current OS<br class="">version but also /usr/include is quite problematic. We can ship a gcc<br class="">supporting the 10.14 SDK or the 10.15 SDK, but not both.<br class=""><br class="">Rebuilding gcc from source would also work.<br class=""><br class="">- Josh<br class=""></div></div></blockquote></div><br class=""></div></body></html>