Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 May 2024 10:57:19 +0100
From:      Nuno Teixeira <eduardo@freebsd.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: build failure affecting port: "error: reference to 'filesystem' is ambiguous"
Message-ID:  <CAFDf7UK7yM38MFoWjbeGV2%2BCEmSMHNnFH3x9rC0z3ujuxc24ZA@mail.gmail.com>
In-Reply-To: <8A27C44B-FBB9-479B-866A-13E06AB8266A@FreeBSD.org>
References:  <CAFDf7UJ2-QgwE0zU8aZ7ZP26NNPYfPYQZDMYQFxGiKDUw9nyOg@mail.gmail.com> <8A27C44B-FBB9-479B-866A-13E06AB8266A@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hello Dimitry,

I've quoted your words in upstream PR and it solved with:

Stop using namespace std
https://github.com/amsynth/amsynth/commit/6fb79100a6254220e5adc69a1428572539ecc377

I'm using patch globally that unbreak main and rest of supported releases
don't complaint about it.

Thanks!

Dimitry Andric <dim@freebsd.org> escreveu (terça, 30/04/2024 à(s) 18:45):

> On 30 Apr 2024, at 14:26, Nuno Teixeira <eduardo@freebsd.org> wrote:
> >
> > I'm lost on build failure of audio/amsynth (updated to version 1.13.3)
> on recent main.
> > Thre strange thing is if I use llvm from ports, USES+=llvm, it fails
> with same error so I suspect that something related to main.
> >
> > Any help is welcome and I didn't openned an upstream PR yet.
> >
> > Thanks,
> >
> > ---
> > src/Configuration.cpp:35:20: error: reference to 'filesystem' is
> ambiguous
> >    35 |         amsynthrc_fname = filesystem::get().config;
> >       |                           ^
> > src/filesystem.h:27:7: note: candidate found by name lookup is
> 'filesystem'
> >    27 | class filesystem
> >       |       ^
> > /usr/include/c++/v1/__chrono/file_clock.h:49:1: note: candidate found by
> name lookup is 'std::filesystem'
> >    49 | _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
> >       | ^
> > /usr/include/c++/v1/__config:892:80: note: expanded from macro
> '_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM'
> >   892 |                                              inline namespace
> __fs { namespace filesystem {
> >       |
>               ^
>
> It looks like the program defines its own "filesystem" class, and also
> has "using namespace std;".
>
> Usually the easiest fix is to use "::filesystem" for the call sites that
> want to use the program's own definition.
>
> Alternatively, rename the 'local' definition to something else, like
> "my_filesystem".
>
> -Dimitry
>
>

-- 
Nuno Teixeira
FreeBSD UNIX:  <eduardo@FreeBSD.org>   Web:  https://FreeBSD.org

[-- Attachment #2 --]
<div dir="ltr"><div>Hello Dimitry,</div><div><br></div><div>I&#39;ve quoted your words in upstream PR and it solved with:</div><div><br></div><div>Stop using namespace std</div><div><a href="https://github.com/amsynth/amsynth/commit/6fb79100a6254220e5adc69a1428572539ecc377">https://github.com/amsynth/amsynth/commit/6fb79100a6254220e5adc69a1428572539ecc377</a></div><div><br></div><div>I&#39;m using patch globally that unbreak main and rest of supported releases don&#39;t complaint about it.<br><br></div><div>Thanks!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Dimitry Andric &lt;<a href="mailto:dim@freebsd.org">dim@freebsd.org</a>&gt; escreveu (terça, 30/04/2024 à(s) 18:45):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 30 Apr 2024, at 14:26, Nuno Teixeira &lt;<a href="mailto:eduardo@freebsd.org" target="_blank">eduardo@freebsd.org</a>&gt; wrote:<br>
&gt; <br>
&gt; I&#39;m lost on build failure of audio/amsynth (updated to version 1.13.3) on recent main.<br>
&gt; Thre strange thing is if I use llvm from ports, USES+=llvm, it fails with same error so I suspect that something related to main.<br>
&gt; <br>
&gt; Any help is welcome and I didn&#39;t openned an upstream PR yet.<br>
&gt; <br>
&gt; Thanks,<br>
&gt; <br>
&gt; ---<br>
&gt; src/Configuration.cpp:35:20: error: reference to &#39;filesystem&#39; is ambiguous<br>
&gt;    35 |         amsynthrc_fname = filesystem::get().config;<br>
&gt;       |                           ^<br>
&gt; src/filesystem.h:27:7: note: candidate found by name lookup is &#39;filesystem&#39;<br>
&gt;    27 | class filesystem<br>
&gt;       |       ^<br>
&gt; /usr/include/c++/v1/__chrono/file_clock.h:49:1: note: candidate found by name lookup is &#39;std::filesystem&#39;<br>
&gt;    49 | _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM<br>
&gt;       | ^<br>
&gt; /usr/include/c++/v1/__config:892:80: note: expanded from macro &#39;_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM&#39;<br>
&gt;   892 |                                              inline namespace __fs { namespace filesystem {<br>
&gt;       |                                                                                ^<br>
<br>
It looks like the program defines its own &quot;filesystem&quot; class, and also<br>
has &quot;using namespace std;&quot;. <br>
<br>
Usually the easiest fix is to use &quot;::filesystem&quot; for the call sites that<br>
want to use the program&#39;s own definition.<br>
<br>
Alternatively, rename the &#39;local&#39; definition to something else, like<br>
&quot;my_filesystem&quot;.<br>
<br>
-Dimitry<br>
<br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><font color="#888888">Nuno Teixeira</font></div><div><div><font color="#888888">
FreeBSD UNIX:  &lt;eduardo@FreeBSD.org&gt;   Web:  <a href="https://FreeBSD.org" rel="noreferrer" target="_blank">https://FreeBSD.org</a><br></font></div></div></div></div>;
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7UK7yM38MFoWjbeGV2%2BCEmSMHNnFH3x9rC0z3ujuxc24ZA>