Can't Compile GZDoom v4.5.0 under Linux

Wed Jan 13, 2021 9:49 am

I followed the compiling guide https://zdoom.org/wiki/Compile_GZDoom_o ... #Compiling
I am using original GZDoom v4.5.0 SourceCode from https://zdoom.org/downloads
On Debian 10 (Stable) x64, last patched today.

There is a compilation error "zmusic.h: No such file or directory", that I can't solve.
Here are my steps:

The first problem was that I needed to add ZMusic:
I compiled ZMusic, in ~/gzdoom_build/ZMusic/, with:
Code:
git clone https://github.com/coelckers/ZMusic.git
cd ZMusic || exit
mkdir build
cd build || exit
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../build_install ..
make install

No breaking errors

Then I added "DCMAKE_PREFIX_PATH" to cmake, as suggested in other forum posts.

Code:
#!/bin/bash
a='' && [ "$(uname -m)" = x86_64 ] && a=64
echo "Target is $a"
c="$(lscpu -p | grep -v '#' | sort -u -t , -k 2,4 | wc -l)"
[ "$c" -eq 0 ] && c=1
echo "CPU is $c"

cd ~/gzdoom_build/gzdoom/build &&
  rm -f output_sdl/liboutput_sdl.so &&
  if [ -d ../fmodapi44464linux ]; then
    echo "Is DFMOD"
    f="-DFMOD_LIBRARY=../fmodapi44464linux/api/lib/libfmodex${a}-4.44.64.so \
-DFMOD_INCLUDE_DIR=../fmodapi44464linux/api/inc"
  else
    echo "Is UFMOD"
    f='-UFMOD_LIBRARY -UFMOD_INCLUDE_DIR'
  fi &&
  g='-DCMAKE_PREFIX_PATH=/home/firewalker/gzdoom_build/ZMusic/build_install'
  cmake .. -DCMAKE_BUILD_TYPE=Release "$f" "$g" &&
  make -j$c


After that I got the following compilation error:
Code:
[ 28%] Building CXX object src/CMakeFiles/zdoom.dir/common/platform/posix/sdl/i_system.cpp.o
In file included from /home/firewalker/gzdoom_build/gzdoom/src/common/platform/posix/sdl/i_system.cpp:55:
/home/firewalker/gzdoom_build/gzdoom/src/common/audio/sound/i_sound.h:41:10: fatal error: zmusic.h: No such file or directory
 #include <zmusic.h>
          ^~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/zdoom.dir/build.make:201: src/CMakeFiles/zdoom.dir/common/platform/posix/sdl/i_system.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1040: src/CMakeFiles/zdoom.dir/all] Error 2
make: *** [Makefile:130: all] Error 2


The zmusic.h does exist though in:
~/gzdoom_build/gzdoom/bin/windows/zmusic/include/zmusic.h
~/gzdoom_build/ZMusic/include/zmusic.h
~/gzdoom_build/ZMusic/build_install/include/zmusic.h

What have I missed here?
Can someone help me compile?

I am happy to help updating the WIKI "Doom_on_Linux#Compiling" once this is solved.

Re: Can't Compile GZDoom v4.5.0 under Linux

Wed Jan 13, 2021 11:55 am

It looks like the compiler can't find the ZMusic library headers. Since you "installed" ZMusic into a path outside of /usr/local, you will need to tell the compiler where the headers are, and you will need to tell the linker where the .so files are.

In addition to gcc arguments/params, there are some environment variables which you can use: LD_LIBRARY_PATH can be used to tell the linker where the .so files are, and C_INCLUDE_PATH and CPLUS_INCLUDE_PATH can be used to tell the compiler where the headers are.

Also, GZDoom ditched FMod since version 2.4.0 (IIRC). GZDoom only uses OpenAL now.

Re: Can't Compile GZDoom v4.5.0 under Linux

Wed Jan 13, 2021 4:16 pm

Ah, right, missed that.
Installed it now the right way ;)
and compiles fine.
Thank you for the help!