From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0GWcFHaWM2fPYAAAqHPOHw:P1 (envelope-from ) for ; Tue, 12 Nov 2024 17:55:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0GWcFHaWM2fPYAAAqHPOHw (envelope-from ) for ; Tue, 12 Nov 2024 18:55:02 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=XdX5i3++; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731434102; a=rsa-sha256; cv=none; b=NNxokNFNAk3gF1cxH9l5uybNhrUmsXexOTsoQSj+R5WfaokzfPc6ptM+Dq2jgYmdVZix9r LGpdtNwosE6bhVFwXQcvQD7h1a66t0QpnTqaik1xeXhiiHKMRlQRRtvEgvjijvG/7EULxP vGUKhVbGuNVEjW6wPbPNcFfmE3Wga8JBL2npAc96NVio5Aczr9oTvGh1rr0Eqkj5iy68tH pa6LF0XC/luvqYhGAELD/FkJGSuVG0iXbf4vEV08Rv+uipZid48NPfMRdlGd4Buc4qr+EB xzHwrel41e+iNwPCeWTTRC9Nsa2pNR4UXTR5GMRXCLTH1bGosAjm5otScFkreA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=XdX5i3++; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731434102; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=MI7XfgNv4+iTpBYCWqJDiDfe6SqhivALxVHQt7FKrCg=; b=DRYqypcqU7iWV9aMlbo/GgUK0hsMsjz+M7B60omjzxzpKDi4FSeGQx/o6MRr2tJlBNaVb5 pwMgdGwlc002UpaerMfOJ9oPaDf+qB55O1WbAdRpyR9TzckqpAectCHFFXC/KejK8nbxm1 wAUoA33DJGH+yV6LM5GriPTzX6Jnpr2eH4kE2+daFXYXgOBK9stb+yDWYOZ+ippJM0/IPl NLrcJ/TNlfAmFIIMDvQVRkTNFbwlwOf7b+i3elIhRJjzZ/Il473/TVuuEZnExh/ASrTc+Z 2jD3oQBA9xyNGKYgrTCDTqdo+dQu3b7nzbmE/mIwzKzRA3G8tyApO03mnktSfA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F1C768338D for ; Tue, 12 Nov 2024 18:55:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAv5t-0000L7-6Z; Tue, 12 Nov 2024 12:54:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAv5p-0000Kg-Iy for help-guix@gnu.org; Tue, 12 Nov 2024 12:54:22 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAv5n-0007s4-I3 for help-guix@gnu.org; Tue, 12 Nov 2024 12:54:21 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 84C37240027 for ; Tue, 12 Nov 2024 18:54:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1731434057; bh=o5zUMO1SMoApUnLyUxBydsNgAfPihdXfWZ953aXlaPs=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=XdX5i3++SIDxRuW0PY1cnybQaydq7v3OVAeSYgYRCilROzkgQK8TZt03yLIUPovTd y0Y0Hq875UG7tKpZicyrOl8e+xdqbL1Nl/myZZBPg4kfKfBYqMNk4gU4KKSuBWjBJF NKodfHxiXMhZ30Pz/qIa5g1Q5+gx81Dk1qM1j5Gm2/WkCFM5DNhCSkhCu3tLhGfh3b 03XYAVV7Q2yXE43UglKEaOE6MhV6cHVJtWbGwskMUSwLXNYVJL5TnJfpCpp2oF3Csb Epblp5z4ea9tb8WpaZ915kniDg7NDl6dXHUpyJHM3GWHu1wSpeE3ku7QrHu2hMM3qK gKkFmCp6a3rOw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XnvDm1Fdqz9rxB; Tue, 12 Nov 2024 18:54:16 +0100 (CET) From: Fredrik Salomonsson To: Laurent Gatto , help-guix@gnu.org Subject: Re: C++ error In-Reply-To: References: Date: Tue, 12 Nov 2024 17:54:14 +0000 Message-ID: <87a5e42v95.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=plattfot@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.37 X-Spam-Score: -1.37 X-Migadu-Queue-Id: F1C768338D X-Migadu-Scanner: mx12.migadu.com X-TUID: ZMwMXv3s5JYb Hi, Laurent Gatto writes: > Dear all, > > I have this very simple code chunk > > $ cat main.cpp > #include > > int main(void) { > std::cout << __cplusplus; > > return 0; > } > > That I can compile in a minimal shell > > $ guix shell --container gcc-toolchain > [env]$ g++ main.cpp && ./a.out > 201703 > > However, on my main system, I get > > $ g++ main.cpp > In file included from /home/lgatto/.guix-profile/include/c++/bits/move.h:= 57, > from > /home/lgatto/.guix-profile/include/c++/bits/exception_ptr.h:43, > from /home/lgatto/.guix-profile/include/c++/exception:15= 3, > from /home/lgatto/.guix-profile/include/c++/ios:39, > from /home/lgatto/.guix-profile/include/c++/ostream:38, > from /home/lgatto/.guix-profile/include/c++/iostream:39, > from main.cpp:1: > /home/lgatto/.guix-profile/include/c++/type_traits:732:26: error: > expected identifier before =E2=80=98(=E2=80=99 token > 732 | _GLIBCXX20_DEPRECATED("use is_standard_layout && > is_trivial instead") > | ^ > /home/lgatto/.guix-profile/include/c++/type_traits:732:27: error: > expected unqualified-id before string constant > 732 | _GLIBCXX20_DEPRECATED("use is_standard_layout && > is_trivial instead") > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~ > /home/lgatto/.guix-profile/include/c++/type_traits:732:27: error: > expected =E2=80=98)=E2=80=99 before string constant > 732 | _GLIBCXX20_DEPRECATED("use is_standard_layout && > is_trivial instead") > | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~ > | ) > /home/lgatto/.guix-profile/include/c++/type_traits:3154:25: error: > expected unqualified-id before string constant > 3154 | _GLIBCXX20_DEPRECATED("use is_standard_layout_v && > is_trivial_v instead") > | > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /home/lgatto/.guix-profile/include/c++/type_traits:3154:25: error: > expected =E2=80=98)=E2=80=99 before string constant > 3154 | _GLIBCXX20_DEPRECATED("use is_standard_layout_v && > is_trivial_v instead") > | > ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | ) > > > Other issues lead me to suspect that I lost support for C++17 and beyond. > > Any idea what/how I messed up and how to fix this? What version is gcc on your main system? Could be that you somehow are running an older gcc than what's in that .guix-profile. I could compile that example just fine on mine. Here is how g++ looks like on my machine, maybe that will help. Note that I'm using guix home to install gcc-toolchain. The version I'm using: ``` $ g++ --version g++ (GCC) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` >From where I'm picking up g++ from: ``` $ which g++ /home/plattfot/.guix-home/profile/bin/g++ ``` Checking the stdc++ lib: ``` $ sed -n '3154p' ~/.guix-home/profile/include/c++/type_traits=20 _GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead") ``` Which matches what you have. Here is the search paths gcc uses on my machine: ``` $ echo | g++ -E -Wp,-v - ignoring nonexistent directory "/no-gcc-local-prefix/include" ignoring nonexistent directory "/gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16= -gcc-11.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.4.0/../../../../../../.= ./x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/plattfot/.guix-home/profile/include /gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16-gcc-11.4.0-lib/lib/gcc/x86_64-= unknown-linux-gnu/11.4.0/include /gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16-gcc-11.4.0-lib/lib/gcc/x86_64-= unknown-linux-gnu/11.4.0/include-fixed /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/include End of search list. # 0 "" # 0 "" # 0 "" # 1 "/home/plattfot/.guix-home/profile/include/stdc-predef.h" 1 3 # 0 "" 2 # 1 "" ``` --=20 s/Fred[re]+i[ck]+/Fredrik/g