CoD4x compile error Ubuntu 64-Bit

Hello everyone!

I wonder if anyone is facing the same problem.
I am trying to compile cod4x18_dedrun (version 21.2) on an Ubunut 64-bit (22.04) machine, following the instructions given in CoD4x_Server GitHub-repository (CoD4x_Server/README.md at 21.2 · callofduty4x/CoD4x_Server · GitHub).

When running the command “make”, I will get this error:

src/sv_bots.cpp: In function ‘void scr_botweapon(scr_entref_t)’:
src/sv_bots.cpp:194:5: error: reference to ‘byte’ is ambiguous
  194 |     byte weapInt;
      |     ^~~~
In file included from /usr/include/c++/11/cmath:42,
                 from /usr/include/c++/11/math.h:36,
                 from src/q_shared.h:45,
                 from src/g_public_mp.h:4,
                 from src/player.h:28,
                 from src/sv_bots.h:4,
                 from src/sv_bots.cpp:1:
/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 src/g_public_mp.h:4,
                 from src/player.h:28,
                 from src/sv_bots.h:4,
                 from src/sv_bots.cpp:1:
src/q_shared.h:129:23: note:                 ‘typedef unsigned char byte’
  129 | typedef unsigned char byte;
      |                       ^~~~
src/sv_bots.cpp:216:5: error: ‘weapInt’ was not declared in this scope; did you mean ‘weapon’?
  216 |     weapInt = (byte)G_GetWeaponIndexForName(weapon);
      |     ^~~~~~~
      |     weapon
src/sv_bots.cpp:216:16: error: reference to ‘byte’ is ambiguous
  216 |     weapInt = (byte)G_GetWeaponIndexForName(weapon);
      |                ^~~~
In file included from /usr/include/c++/11/cmath:42,
                 from /usr/include/c++/11/math.h:36,
                 from src/q_shared.h:45,
                 from src/g_public_mp.h:4,
                 from src/player.h:28,
                 from src/sv_bots.h:4,
                 from src/sv_bots.cpp:1:
/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 src/g_public_mp.h:4,
                 from src/player.h:28,
                 from src/sv_bots.h:4,
                 from src/sv_bots.cpp:1:
src/q_shared.h:129:23: note:                 ‘typedef unsigned char byte’
  129 | typedef unsigned char byte;
      |                       ^~~~
make: *** [makefile:224: obj/sv_bots.o] Error 1

This error is saying, that there is a conflict:
type ‘byte’ is defined as ‘unsigned char’ in ‘src/q_shared.h’
type ‘byte’ is defined as ‘unsigned char’ in ‘/usr/include/c++/11/bits/cpp_type_traits.h’

The compiler does not know which one to use, so it throws an error.
I don’t know why this happens, I did not apply any changes in the source code from here. Either I am doing something wrong or the instructions (for Ubunut 64-bit) contain errors.

Anyways, I tried to change ‘byte’ to ‘unsigned char’ in the affected areas from the error (sv_bots.cpp / sv_bots.h), since this is the same.
Tried to compile again and faced another error. This one is a bit hard to describe, the log output is very long to post here, so I will only post a snap of it:

You build CoD4 version: 21.2
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
Server start
make mbedtls
make[1]: Entering directory '/home/CoD4x_Server-21.2/src/mbedtls'
Mbedtls start
Mbedtls done
make[1]: Leaving directory '/home/CoD4x_Server-21.2/src/mbedtls'
make tomcrypt
make[1]: Entering directory '/home/CoD4x_Server-21.2/src/tomcrypt'
TomCrypt start
TomCrypt done
make[1]: Leaving directory '/home/CoD4x_Server-21.2/src/tomcrypt'
gcc obj/version.o -DCOD4X18UPDATE -DBUILD_NUMBER=0 -DBUILD_BRANCH=no-branch -DBUILD_REVISION=no-revision -D_GNU_SOURCE
gcc bin/cod4x18_dedrun
/usr/bin/ld: obj/sv_main.o:(.bss+0xa276848): multiple definition of `g_motd'; obj/g_sv_main.o:(.bss+0x39c): first defined here
/usr/bin/ld: obj/bg_jump.o:(.bss+0x10): multiple definition of `jump_height'; obj/g_sv_main.o:(.bss+0x54): first defined here
/usr/bin/ld: obj/bg_jump.o:(.bss+0x8): multiple definition of `jump_slowdownEnable'; obj/g_sv_main.o:(.bss+0x4c): first defined here

[...]

src/asmsource/_bg_mantle.asm:(.bss+0x0): multiple definition of `mantle_enable'; obj/g_sv_main.o:(.bss+0x40): first defined here
/usr/bin/ld: obj/_bg_mantle.o: in function `mantle_view_yawcap':
src/asmsource/_bg_mantle.asm:(.bss+0x4): multiple definition of `mantle_view_yawcap'; obj/g_sv_main.o:(.bss+0x2c): first defined here
/usr/bin/ld: obj/_bg_mantle.o: in function `mantle_debug':
src/asmsource/_bg_mantle.asm:(.bss+0xc): multiple definition of `mantle_debug'; obj/g_sv_main.o:(.bss+0x3c): first defined here

[...]

/usr/bin/ld: obj/sv_client.o: in function `SV_ReceiveStats_f':
sv_client.c:(.text+0x1401): undefined reference to `rijndael_setup'
/usr/bin/ld: sv_client.c:(.text+0x14e6): undefined reference to `rijndael_ecb_decrypt'
/usr/bin/ld: sv_client.c:(.text+0x151e): undefined reference to `rijndael_done'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [makefile:199: bin/cod4x18_dedrun] Error 1

‘multiple definition’ anywhere in the error.
Now, after trying to fixing for many hours, I am about to give up.
I also tried it on an Ubuntu 64-Bit (20.04) machine, Ubuntu 32-Bit machine (with the instruction for that machine) and Windows (instruction for Windows), but getting other errors.
Maybe some smart people are here and know some solutions. Thanks for any help!

Hi @R34N
Contact me, i will help you.