all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Laurent Gatto <laurent.gatto@gmail.com>
To: Fredrik Salomonsson <plattfot@posteo.net>
Cc: help-guix@gnu.org
Subject: Re: C++ error
Date: Sat, 16 Nov 2024 14:19:04 +0100	[thread overview]
Message-ID: <CA+uNOzgZ8V4knLFarQUFLDAgzwGW+QxN7_-Goz1e1TKT7DaOcg@mail.gmail.com> (raw)
In-Reply-To: <CA+uNOzgjk8-O7Nbn6Rpiovq8QCYPJGvgYsNWkoTghJG8+E-QMg@mail.gmail.com>

On Sat, 16 Nov 2024 at 11:56, Laurent Gatto <laurent.gatto@gmail.com> wrote:
>
> Hi Fredrik,
>
> Excellent advice, and I was able to identify the culprit.
>
> Here's a simple reproducible example
>
> $ guix shell --container gcc-toolchain
> [env]$ g++ main.cpp
> [env]$ exit
>
> $ guix shell --container gcc-toolchain gfortran-toolchain
> [env]$ g++ main.cpp
> In file included from
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/bits/move.h:57,
>                  from
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/bits/exception_ptr.h:43,
>                  from
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/exception:153,
>                  from
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/ios:39,
>                  from
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/ostream:38,
>                  from
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/iostream:39,
>                  from main.cpp:1:
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/type_traits:732:26:
> error: expected identifier before '(' token
>   732 |     _GLIBCXX20_DEPRECATED("use is_standard_layout &&
> is_trivial instead")
>       |                          ^
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/type_traits:732:27:
> error: expected unqualified-id before string constant
>   732 |     _GLIBCXX20_DEPRECATED("use is_standard_layout &&
> is_trivial instead")
>       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/type_traits:732:27:
> error: expected ')' before string constant
>   732 |     _GLIBCXX20_DEPRECATED("use is_standard_layout &&
> is_trivial instead")
>       |                          ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                           )
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-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")
>       |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /gnu/store/68l504nyvms77jzfg9yf4njiyfbi8gm2-profile/include/c++/type_traits:3154:25:
> error: expected ')' before string constant
>  3154 |   _GLIBCXX20_DEPRECATED("use is_standard_layout_v &&
> is_trivial_v instead")
>       |
> ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                         )

The order of the packages does matter. The above fails, but if I pass
gfortran-toolchain before gcc-toolchain, it works:

$ guix shell --container gfortran-toolchain gcc-toolchain
[env]$ g++ main.cpp
[env]$ ./a.out
201703

Is this really expected?

> I also confirmed that I was able to compile that source code by simply
> commenting gfortran-toolchain in my system manifest.
>
> Isn't this weird though? What if I need both?
>
>
> Laurent


      reply	other threads:[~2024-11-16 13:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12  7:41 C++ error Laurent Gatto
2024-11-12 17:54 ` Fredrik Salomonsson
2024-11-12 20:26   ` Laurent Gatto
2024-11-13  0:50     ` Fredrik Salomonsson
2024-11-13  6:49       ` Laurent Gatto
2024-11-13 19:12         ` Fredrik Salomonsson
2024-11-13 21:33           ` Laurent Gatto
2024-11-14 18:51             ` Fredrik Salomonsson
2024-11-16 10:56               ` Laurent Gatto
2024-11-16 13:19                 ` Laurent Gatto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+uNOzgZ8V4knLFarQUFLDAgzwGW+QxN7_-Goz1e1TKT7DaOcg@mail.gmail.com \
    --to=laurent.gatto@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=plattfot@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.