Can't Compile GZDoom v4.5.0 under Linux

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Post Reply
User avatar
Firewalker
Posts: 7
Joined: Fri Aug 31, 2018 3:37 pm

Can't Compile GZDoom v4.5.0 under Linux

Post by Firewalker »

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: Select all

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: Select all

#!/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: Select all

[ 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.
Talon1024
 
 
Posts: 376
Joined: Mon Jun 27, 2016 7:26 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Contact:

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

Post by Talon1024 »

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.
User avatar
Firewalker
Posts: 7
Joined: Fri Aug 31, 2018 3:37 pm

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

Post by Firewalker »

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

Return to “Technical Issues”