GDS3D
GDS3D copied to clipboard
Compilation failed with clang-16: error: reference to 'byte' is ambiguous
In file included from main.cpp:29:
In file included from ./main.h:24:
In file included from ./../gdsoglviewer/windowmanager.h:29:
../libgdsto3d/gds_globals.h:119:2: error: reference to 'byte' is ambiguous
byte RecordType;
^
../libgdsto3d/gds_globals.h:115:23: note: candidate found by name lookup is 'byte'
typedef unsigned char byte;
^
/usr/include/c++/v1/cstddef:72:12: note: candidate found by name lookup is 'std::byte'
enum class byte : unsigned char {};
^
In file included from main.cpp:29:
In file included from ./main.h:24:
In file included from ./../gdsoglviewer/windowmanager.h:29:
../libgdsto3d/gds_globals.h:120:2: error: reference to 'byte' is ambiguous
byte DataType;
^
../libgdsto3d/gds_globals.h:115:23: note: candidate found by name lookup is 'byte'
typedef unsigned char byte;
^
/usr/include/c++/v1/cstddef:72:12: note: candidate found by name lookup is 'std::byte'
enum class byte : unsigned char {};
^
In file included from main.cpp:29:
In file included from ./main.h:24:
In file included from ./../gdsoglviewer/windowmanager.h:29:
../libgdsto3d/gds_globals.h:121:2: error: reference to 'byte' is ambiguous
byte *Data;
^
../libgdsto3d/gds_globals.h:115:23: note: candidate found by name lookup is 'byte'
typedef unsigned char byte;
^
/usr/include/c++/v1/cstddef:72:12: note: candidate found by name lookup is 'std::byte'
enum class byte : unsigned char {};
^
Revision: 173da0c FreeBSD 13.2
getting a similar error:
make: Entering directory '/home/calvin/GDS3D/linux'
g++ -c -w -O1 -I ../math/ -I ../gdsoglviewer/ -I ../libgdsto3d/ main.cpp -o main.o
In file included from ../gdsoglviewer/windowmanager.h:29,
from main.h:24,
from main.cpp:29:
../libgdsto3d/gds_globals.h:119:9: error: reference to ‘byte’ is ambiguous
119 | byte RecordType;
| ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:61,
from /usr/include/c++/11/bits/char_traits.h:39,
from /usr/include/c++/11/string:40,
from ../libgdsto3d/gds_globals.h:33,
from ../gdsoglviewer/windowmanager.h:29,
from main.h:24,
from main.cpp:29:
/usr/include/c++/11/bits/cpp_type_traits.h:404:30: note: candidates are: ‘enum class std::byte’
404 | enum class byte : unsigned char;
| ^~~~
In file included from ../gdsoglviewer/windowmanager.h:29,
from main.h:24,
from main.cpp:29:
../libgdsto3d/gds_globals.h:115:23: note: ‘typedef unsigned char byte’
115 | typedef unsigned char byte;
| ^~~~
../libgdsto3d/gds_globals.h:120:9: error: reference to ‘byte’ is ambiguous
120 | byte DataType;
| ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:61,
from /usr/include/c++/11/bits/char_traits.h:39,
from /usr/include/c++/11/string:40,
from ../libgdsto3d/gds_globals.h:33,
from ../gdsoglviewer/windowmanager.h:29,
from main.h:24,
from main.cpp:29:
/usr/include/c++/11/bits/cpp_type_traits.h:404:30: note: candidates are: ‘enum class std::byte’
404 | enum class byte : unsigned char;
| ^~~~
In file included from ../gdsoglviewer/windowmanager.h:29,
from main.h:24,
from main.cpp:29:
../libgdsto3d/gds_globals.h:115:23: note: ‘typedef unsigned char byte’
115 | typedef unsigned char byte;
| ^~~~
../libgdsto3d/gds_globals.h:121:9: error: reference to ‘byte’ is ambiguous
121 | byte *Data;
| ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:61,
from /usr/include/c++/11/bits/char_traits.h:39,
from /usr/include/c++/11/string:40,
from ../libgdsto3d/gds_globals.h:33,
from ../gdsoglviewer/windowmanager.h:29,
from main.h:24,
from main.cpp:29:
/usr/include/c++/11/bits/cpp_type_traits.h:404:30: note: candidates are: ‘enum class std::byte’
404 | enum class byte : unsigned char;
| ^~~~
In file included from ../gdsoglviewer/windowmanager.h:29,
from main.h:24,
from main.cpp:29:
../libgdsto3d/gds_globals.h:115:23: note: ‘typedef unsigned char byte’
115 | typedef unsigned char byte;
| ^~~~
make: *** [Makefile:32: main.o] Error 1
make: Leaving directory '/home/calvin/GDS3D/linux'
when running make -C linux
on Pop!_OS 22.04 LTS
@yurivict and @calvbore , did you manage to find a solution? I am having the same problem.
I've just made pull request #24 for a workaround for this problem.
I accept the pull request