source does not compile
Closed this issue · 6 comments
source does not compile
savegame.c
===> CC src/savegame/savegame.c
src/savegame/savegame.c:65:2: error: #error YQ2OSTYPE should be defined by the build system
65 | #error YQ2OSTYPE should be defined by the build system
| ^~~~~
src/savegame/savegame.c:69:2: error: #error YQ2ARCH should be defined by the build system
69 | #error YQ2ARCH should be defined by the build system
| ^~~~~
src/savegame/savegame.c: In function 'WriteGame':
src/savegame/savegame.c:772:26: error: 'YQ2OSTYPE' undeclared (first use in this function)
772 | Q_strlcpy(sv.os, YQ2OSTYPE, sizeof(sv.os) - 1);
| ^~~~~~~~~
src/savegame/savegame.c:772:26: note: each undeclared identifier is reported only once for each function it appears in
src/savegame/savegame.c:773:28: error: 'YQ2ARCH' undeclared (first use in this function)
773 | Q_strlcpy(sv.arch, YQ2ARCH, sizeof(sv.arch));
| ^~~~~~~
src/savegame/savegame.c: In function 'ReadGame':
src/savegame/savegame.c:875:40: error: 'YQ2OSTYPE' undeclared (first use in this function)
875 | else if (strcmp(sv.os, YQ2OSTYPE) != 0)
| ^~~~~~~~~
src/savegame/savegame.c:880:42: error: 'YQ2ARCH' undeclared (first use in this function)
880 | else if (strcmp(sv.arch, YQ2ARCH) != 0)
| ^~~~~~~
make[1]: *** [Makefile:174: build/src/savegame/savegame.o] Error 1
It builds for me. Are you on the latest git head? And what platform are you compiling on?
I just used this to compile on Debian 11 Bookworm without a problem:
#!/bin/bash
# Bash4: |& = 2>&1
#apt install build-essential libgl1-mesa-dev libsdl2-dev libopenal-dev libcurl4-openssl-dev
while getopts 'fh' OPT; do
case $OPT in
f)
# Force new source
sudo rm -r rogue
sudo rm -r xatrix
sudo rm -r yquake2
sudo rm -r zaero
sudo rm -r ctf
;;
h)
echo 'Usage: build.sh [-f]'
echo '-f: Force new download of source'
echo
exit 0
;;
esac
done
if [ ! -e yquake2 ]; then
git clone https://github.com/yquake2/yquake2.git
fi
if [ ! -e rogue ]; then
git clone https://github.com/yquake2/rogue.git
fi
if [ ! -e xatrix ]; then
git clone https://github.com/yquake2/xatrix.git
fi
if [ ! -e zaero ]; then
git clone https://github.com/yquake2/zaero.git
fi
if [ ! -e ctf ]; then
git clone https://github.com/yquake2/ctf.git
fi
cd yquake2
git pull
rm -rf build
mkdir build
cd build
cmake .. |& tee ../../build.log
cmake --build . |& tee -a ../../build.log
echo -e "\n========================================================\n" |& tee -a ../../build.log
cd ../..
cd rogue
git pull
rm -r build
mkdir build
cd build
cmake .. |& tee -a ../../build.log
cmake --build . |& tee -a ../../build.log
echo -e "\n========================================================\n" |& tee -a ../../build.log
cd ../..
cd xatrix
git pull
rm -r build
mkdir build
cd build
cmake .. |& tee -a ../../build.log
cmake --build . |& tee -a ../../build.log
echo -e "\n========================================================\n" |& tee -a ../../build.log
cd ../..
cd zaero
git pull
rm -r build
mkdir build
cd build
cmake .. |& tee -a ../../build.log
cmake --build . |& tee -a ../../build.log
echo -e "\n========================================================\n" |& tee -a ../../build.log
cd ../..
cd ctf
git pull
rm -r build
mkdir build
cd build
cmake .. |& tee -a ../../build.log
cmake --build . |& tee -a ../../build.log
echo -e "\n========================================================\n" |& tee -a ../../build.log
cd ../..
rm -rf release_linux
mkdir -p release_linux/rogue release_linux/xatrix release_linux/zaero release_linux/ctf
cp -rvf yquake2/build/release/* release_linux/
cp -vf rogue/build/Debug/game.so release_linux/rogue
cp -vf xatrix/build/Debug/game.so release_linux/xatrix
cp -vf zaero/build/Debug/game.so release_linux/zaero
cp -vf ctf/build/Debug/game.so release_linux/ctf
If you want I can upload the binaries.
It builds for me. Are you on the latest git head? And what platform are you compiling on?
thanks for the answer... i just used the same commands for compilation that i used for quake 2, the reckoning and ground zero.
i compile on windows 11, i downloaded the MSYS2 package available here, i used mingw32.exe
i usually just extract the zip file downloaded here, in home"username"
in this case zaero-master
and do a:
cd zaero-master
make
and get this
===> Building game.dll
make release/game.dll
make[1]: Entering directory '/home/Dremor/zaero-master'
===> CC src/g_ai.c
===> CC src/g_cmds.c
===> CC src/g_combat.c
===> CC src/g_func.c
===> CC src/g_items.c
===> CC src/g_main.c
===> CC src/g_misc.c
===> CC src/g_monster.c
===> CC src/g_phys.c
===> CC src/g_spawn.c
===> CC src/g_svcmds.c
===> CC src/g_target.c
===> CC src/g_trigger.c
===> CC src/g_turret.c
===> CC src/g_utils.c
===> CC src/g_weapon.c
===> CC src/monster/actor/actor.c
===> CC src/monster/berserker/berserker.c
===> CC src/monster/boss/boss.c
===> CC src/monster/boss2/boss2.c
===> CC src/monster/boss3/boss3.c
===> CC src/monster/boss3/boss31.c
===> CC src/monster/boss3/boss32.c
===> CC src/monster/brain/brain.c
===> CC src/monster/chick/chick.c
===> CC src/monster/flipper/flipper.c
===> CC src/monster/float/float.c
===> CC src/monster/flyer/flyer.c
===> CC src/monster/gladiator/gladiator.c
===> CC src/monster/gunner/gunner.c
===> CC src/monster/handler/handler.c
===> CC src/monster/hound/hound.c
===> CC src/monster/hover/hover.c
===> CC src/monster/infantry/infantry.c
===> CC src/monster/insane/insane.c
===> CC src/monster/medic/medic.c
===> CC src/monster/misc/move.c
===> CC src/monster/mutant/mutant.c
===> CC src/monster/parasite/parasite.c
===> CC src/monster/sentien/sentien.c
===> CC src/monster/soldier/soldier.c
===> CC src/monster/supertank/supertank.c
===> CC src/monster/tank/tank.c
===> CC src/player/client.c
===> CC src/player/hud.c
===> CC src/player/trail.c
===> CC src/player/view.c
===> CC src/player/weapon.c
===> CC src/savegame/savegame.c
src/savegame/savegame.c:65:2: error: #error YQ2OSTYPE should be defined by the build system
65 | #error YQ2OSTYPE should be defined by the build system
| ^~~~~
src/savegame/savegame.c:69:2: error: #error YQ2ARCH should be defined by the build system
69 | #error YQ2ARCH should be defined by the build system
| ^~~~~
src/savegame/savegame.c: In function 'WriteGame':
src/savegame/savegame.c:772:26: error: 'YQ2OSTYPE' undeclared (first use in this function)
772 | Q_strlcpy(sv.os, YQ2OSTYPE, sizeof(sv.os) - 1);
| ^~~~~~~~~
src/savegame/savegame.c:772:26: note: each undeclared identifier is reported only once for each function it appears in
src/savegame/savegame.c:773:28: error: 'YQ2ARCH' undeclared (first use in this function)
773 | Q_strlcpy(sv.arch, YQ2ARCH, sizeof(sv.arch));
| ^~~~~~~
src/savegame/savegame.c: In function 'ReadGame':
src/savegame/savegame.c:875:40: error: 'YQ2OSTYPE' undeclared (first use in this function)
875 | else if (strcmp(sv.os, YQ2OSTYPE) != 0)
| ^~~~~~~~~
src/savegame/savegame.c:880:42: error: 'YQ2ARCH' undeclared (first use in this function)
880 | else if (strcmp(sv.arch, YQ2ARCH) != 0)
| ^~~~~~~
make[1]: *** [Makefile:174: build/src/savegame/savegame.o] Error 1
make[1]: Leaving directory '/home/Dremor/zaero-master'
make: *** [Makefile:169: zaero] Error 2
(Dremor@Nixos)[3] ~/zaero-master %
I just used this to compile on Debian 11 Bookworm without a problem:
If you want I can upload the binaries.
nah thanks, at least now i know it compiles on linux ^^
i do not use linux, but it is still nice to know... my plan was to create a modified version of quake that is customizable.
https://www.nexusmods.com/quake2/mods/11
just with a simple text editor, value of weapons, armor, ammo, damage received and so on... including the reckoning phalanx magslug weapon that now shoots 2 smartguided projectiles (so when a monster dies with 1 projectile, the left over projectile change course and harms another target.)
my modding got stopped by my inability to simply compile under windows 11, the zip file downloaded here of zaero... but i am still glad that i could customize the official game and its 2 official expansions...
if there is no clear solution or fix for this, i can always try linux in the future and try to compile under linux... i hope i will not be too much inept :D
update:
i was able to compile using mingw64.exe
(i think to remember that either quake2 or its expansion do not compile well/at all using mingw64.exe so i never used it)
i did a try, and it seems i can del a .dll file for zaero.
i cannot test exactly right now if the file works, still i plan to close this issue anyway.
i have the impression that original quake2, the reckoning and ground zero requires mingw32.exe to compile successfully.
for zaero i get an error using mingw32.exe but i get a dll file using mingw64.exe
i am happy, i hope i will not have a bad surprise in the future... if anything i will write a new report :P
thanks again for the answers.
I've just pushed a fix. The addon can now be build with the current build environment under Windows.