Discussion:
build failure affecting port: "error: reference to 'filesystem' is ambiguous"
(too old to reply)
Nuno Teixeira
2024-04-30 12:26:08 UTC
Permalink
Hello all,

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 {
|
^
src/Configuration.cpp:60:22: error: reference to 'filesystem' is ambiguous
60 | current_bank_file = filesystem::get().default_bank;
| ^
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 {
|
^
2 errors generated.
gmake[2]: *** [Makefile:3376: src/amsynth_dssi_gtk-Configuration.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
src/PresetController.cpp:474:9: error: reference to 'filesystem' is
ambiguous
474 | return filesystem::get().user_banks;
| ^
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 {
|
^
mv -f src/.deps/amsynth-AudioOutput.Tpo src/.deps/amsynth-AudioOutput.Po
1 error generated.
---
--
Nuno Teixeira
FreeBSD UNIX: <***@FreeBSD.org> Web: https://FreeBSD.org
Dimitry Andric
2024-04-30 17:45:45 UTC
Permalink
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



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Dimitry Andric
2024-05-02 12:03:12 UTC
Permalink
Nice to see that upstream chose the more correct solution. :)

-Dimitry
Post by Nuno Teixeira
Hello Dimitry,
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!
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
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Nuno Teixeira
2024-05-02 09:57:19 UTC
Permalink
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!
Post by Nuno Teixeira
I'm lost on build failure of audio/amsynth (updated to version 1.13.3)
on recent main.
Post by Nuno Teixeira
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.
Post by Nuno Teixeira
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
Post by Nuno Teixeira
35 | amsynthrc_fname = filesystem::get().config;
| ^
src/filesystem.h:27:7: note: candidate found by name lookup is
'filesystem'
Post by Nuno Teixeira
27 | class filesystem
| ^
/usr/include/c++/v1/__chrono/file_clock.h:49:1: note: candidate found by
name lookup is 'std::filesystem'
Post by Nuno Teixeira
49 | _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
| ^
/usr/include/c++/v1/__config:892:80: note: expanded from macro
'_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM'
Post by Nuno Teixeira
892 | inline namespace
__fs { namespace filesystem {
Post by Nuno Teixeira
|
^
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: <***@FreeBSD.org> Web: https://FreeBSD.org
Loading...