From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Clang c++ include path Date: Mon, 28 Oct 2019 09:19:23 +0100 Message-ID: <87y2x5z352.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:52917) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP0N9-0003JI-S3 for guix-devel@gnu.org; Mon, 28 Oct 2019 04:27:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iP0N8-0002kh-Cs for guix-devel@gnu.org; Mon, 28 Oct 2019 04:27:31 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:40046) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iP0N8-0002jg-7c for guix-devel@gnu.org; Mon, 28 Oct 2019 04:27:30 -0400 Received: by mail-wm1-x333.google.com with SMTP id w9so8074401wmm.5 for ; Mon, 28 Oct 2019 01:27:29 -0700 (PDT) Received: from meru (lfbn-ann-1-367-71.w86-200.abo.wanadoo.fr. [86.200.83.71]) by smtp.gmail.com with ESMTPSA id u1sm9407543wmc.38.2019.10.28.01.27.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 01:27:27 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Guix-devel Message-ID: <87r22xxoy6.fsf@gmail.com> User-agent: mu4e 1.2.0; emacs 26.3 https://issues.guix.info/issue/32773, mathieu@meru:~/tmp$ ~/.guix-profile/bin/clang t.cpp t.cpp:1:10: fatal error: 'string' file not found mathieu@meru:~/tmp$ ~/.guix-profile/bin/clang -v t.cpp t.cpp:1:10: fatal error: 'string' file not found mathieu@meru:~/tmp$ ~/.guix-profile/bin/g++ -v t.cpp Hello, When running clang on a c++ program, it cannot find c++ std libraries. That's because, those libraries path are hardcoded inside g++ compiler and clang cannot find them. This has already been discussed here: without reaching a solution. Running this program, --8<---------------cut here---------------start------------->8--- #include int main() { return 0; } --8<---------------cut here---------------end--------------->8--- I have this error: --8<---------------cut here---------------start------------->8--- #include ^~~~~~~~ 1 error generated. --8<---------------cut here---------------end--------------->8--- that's because: --8<---------------cut here---------------start------------->8--- ... #include "..." search starts here: #include <...> search starts here: /gnu/store/933ijsm5wwjkvlh963lc3pxc7i3dfxcp-profile/include /gnu/store/i2vzqb02gxcm5c2zix92lq3ay73kbl9s-clang-8.0.0/lib/clang/8.0.0/include /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/include End of search list. #include ^~~~~~~~ 1 error generated. --8<---------------cut here---------------end--------------->8--- whereas, --8<---------------cut here---------------start------------->8--- ... #include "..." search starts here: #include <...> search starts here: /gnu/store/933ijsm5wwjkvlh963lc3pxc7i3dfxcp-profile/include /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/include/c++ [1] /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/include/c++/x86_64-unknown-linux-gnu [2] /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/include/c++/backward [3] /gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/include /gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/include-fixed /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/include ... --8<---------------cut here---------------end--------------->8--- Hardcoding the paths [1], [2] and [3] into clang would solve the issue, but it might not be the better way to proceed. WDYT? Mathieu