Menu

#66 Compilation error in Engine/Core/SYS_Defs.h

1.0
open
nobody
None
2022-12-11
2022-07-29
No

Hi!
When I try to open the program, I get the following error:

libxcb-util.so.0: cannot open shared object file: No such file or directory

After finding a post about the same problem(https://sourceforge.net/p/c64-debugger/tickets/34/), I tried compiling from the source code, but I get the following errors:

MM -- Engine/Core/CConfigStorage.o
In file included from Engine/Core/CConfigStorage.h:4,
                 from Engine/Core/CConfigStorage.mm:1:
Engine/Core/SYS_Defs.h:12:14: error: unnamed scoped enum is not allowed
   12 | #define byte unsigned char
      |              ^~~~~~~~
Engine/Core/SYS_Defs.h:12:14: error: expected identifier before unsigned
In file included from /usr/include/c++/11/cmath:42,
                 from /usr/include/c++/11/math.h:36,
                 from Engine/Core/SYS_Defs.h:274,
                 from Engine/Core/CConfigStorage.h:4,
                 from Engine/Core/CConfigStorage.mm:1:
/usr/include/c++/11/bits/cpp_type_traits.h:404:19: error: expected unqualified-id before : token
  404 |   enum class byte : unsigned char;
      |                   ^
/usr/include/c++/11/bits/cpp_type_traits.h:407:12: error: redefinition of struct std::__is_byte<unsigned char>
  407 |     struct __is_byte<byte>
      |            ^~~~~~~~~~~~~~~
/usr/include/c++/11/bits/cpp_type_traits.h:397:12: note: previous definition of struct std::__is_byte<unsigned char>
  397 |     struct __is_byte<unsigned char>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/cpp_type_traits.h:533:63: error: wrong number of template arguments (1, should be at least 2)
  533 |     struct __is_memcmp_ordered_with<std::byte, std::byte, true>
      |                                                               ^
/usr/include/c++/11/bits/cpp_type_traits.h:511:12: note: provided for template<class _Tp, class _Up, bool <anonymous> > struct std::__is_memcmp_ordered_with
  511 |     struct __is_memcmp_ordered_with
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/cpp_type_traits.h:537:62: error: template argument 2 is invalid
  537 |     struct __is_memcmp_ordered_with<_Tp, std::byte, _SameSize>
      |                                                              ^
/usr/include/c++/11/bits/cpp_type_traits.h:537:62: error: template argument 3 is invalid
/usr/include/c++/11/bits/cpp_type_traits.h:541:62: error: wrong number of template arguments (1, should be at least 2)
  541 |     struct __is_memcmp_ordered_with<std::byte, _Up, _SameSize>
      |                                                              ^
/usr/include/c++/11/bits/cpp_type_traits.h:511:12: note: provided for template<class _Tp, class _Up, bool <anonymous> > struct std::__is_memcmp_ordered_with
  511 |     struct __is_memcmp_ordered_with
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from Engine/Core/CConfigStorage.h:4,
                 from Engine/Core/CConfigStorage.mm:1:
Engine/Core/SYS_Defs.h:282:14: error: unnamed scoped enum is not allowed
  282 | #define byte unsigned char
      |              ^~~~~~~~
Engine/Core/SYS_Defs.h:282:14: error: expected identifier before unsigned
In file included from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from Engine/Core/CConfigStorage.mm:4:
/usr/include/c++/11/functional:979:19: error: expected unqualified-id before : token
  979 |   enum class byte : unsigned char;
      |                   ^
make: *** [Makefile:71: Engine/Core/CConfigStorage.o] Error 1

After messing with the source code, I managed to get the following error by commenting out line 11-13 in Engine/Core/SYS_Defs.h:

MM -- Engine/Core/CConfigStorage.o
In file included from Engine/Core/CConfigStorage.h:4,
                 from Engine/Core/CConfigStorage.mm:1:
Engine/Core/SYS_Defs.h:282:14: error: unnamed scoped enum is not allowed
  282 | #define byte unsigned char
      |              ^~~~~~~~
Engine/Core/SYS_Defs.h:282:14: error: expected identifier before unsigned
In file included from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from Engine/Core/CConfigStorage.mm:4:
/usr/include/c++/11/functional:979:19: error: expected unqualified-id before : token
  979 |   enum class byte : unsigned char;
      |                   ^
make: *** [Makefile:71: Engine/Core/CConfigStorage.o] Error 1

I'm using Ubuntu 22.04, on a fresh install

Discussion

  • slajerek

    slajerek - 2022-12-06

    This may be related to gcc version and new requirements or includes. Which gcc version you are using? This compiled for me. Please note the development moved now to Retro Debugger, there was indeed a lot of mess related to the "#define byte unsigned char" as it clashes with emulators' own implementations. That was completely refactored in Retro Debugger (i.e. there's no more 'byte' definition and it was replaced to 'u8').

    Please use older C++ flavour to compile this older C64 Debugger.

     
  • Luk

    Luk - 2022-12-11

    Hi, just for information of anyone finding this. I'm getting same errors with gcc 12 as well as gcc 11.

    I'm going to try with gcc8 if I can get it working on a modern system.

    In the meantime, anyone having issue with libxcb-util.so.0 not being present can try to link libxcb-util.so.1 to 0. First of course you need to have libxcb-util installed as per your distro package manager.

    I just used: sudo ln -s /usr/lib/libxcb-util.so.1.0.0 /usr/lib/libxcb-util.so.0

    And for me the binary works on the latest Arch.

     

    Last edit: Luk 2022-12-11

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.