Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
801 stars 62 forks source link

How compile ? #390

Closed inukaze closed 2 years ago

inukaze commented 2 years ago

Hi there i am trying to compile the source code but i just got errors at the end.

Here the things i try :

cd /tmp
git clone https://github.com/Interrupt/systemshock Shockolate
nano build_deps.sh

i change the line

git clone https://github.com/Doom64/fluidsynth-lite.git

--by--

git clone https://github.com/parhelia512/fluidsynth-lite

Because the first line ever ask by login and password of that github instead download src

./build_deps.sh
cmake -ENABLE_SDL2=ON ENABLE_SOUND=ON .
make

Output :

[100%] Linking CXX executable systemshock
/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/../../../../lib64/libSDL2_mixer.so: referencia a `SDL_RWclose' sin definir
/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/../../../../lib64/libSDL2_mixer.so: referencia a `SDL_RWread' sin definir
/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/../../../../lib64/libSDL2_mixer.so: referencia a `SDL_RWseek' sin definir
/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/../../../../lib64/libSDL2_mixer.so: referencia a `SDL_RWtell' sin definir
collect2: error: ld devolvió el estado de salida 1
CMakeFiles/systemshock.dir/build.make:263: fallo en las instrucciones para el objetivo 'systemshock'
make[2]: *** [systemshock] Error 1
CMakeFiles/Makefile2:189: fallo en las instrucciones para el objetivo 'CMakeFiles/systemshock.dir/all'
make[1]: *** [CMakeFiles/systemshock.dir/all] Error 2
Makefile:102: fallo en las instrucciones para el objetivo 'all'
make: *** [all] Error 2

the weird is i recently had donwload and compile manually that source code directly from SDL2 site, and install on my system, and are the same version, but with the bundle works and with the my system just not.

i try to purge the SDL2_mixer of system, and install on system the SDL2_mixer downloaded by script build_deps.sh using ./configure --prefix=/usr ; make ; make install ; ldconfig

i do on the Shockolate src folder :

make clean
cmake -ENABLE_SDL2=ON ENABLE_SOUND=ON .
make

output :

[ 98%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/SDLSound.c.o
[ 98%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/Modding.c.o
[ 99%] Building CXX object CMakeFiles/systemshock.dir/src/MacSrc/OpenGL.cc.o
[ 99%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/Xmi.c.o
[ 99%] Building C object CMakeFiles/systemshock.dir/src/MusicSrc/MusicDevice.c.o
make[2]: *** No hay ninguna regla para construir el objetivo '/usr/lib64/libSDL2_mixer.so', necesario para 'systemshock'.  Alto.
CMakeFiles/Makefile2:189: fallo en las instrucciones para el objetivo 'CMakeFiles/systemshock.dir/all'
make[1]: *** [CMakeFiles/systemshock.dir/all] Error 2
Makefile:102: fallo en las instrucciones para el objetivo 'all'
make: *** [all] Error 2

i try the same thing with just SDL2-2.0.1.4, removing from system, and install on system the bundle with the same line ./configure --prefix=/usr ; make ; make install ; ldconfig

and go back to the Shockolate src and i did the follow :

make clean
cmake -ENABLE_SDL2=ON ENABLE_SOUND=ON .
make

Output :

[ 98%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/SDLSound.c.o
[ 98%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/Modding.c.o
[ 99%] Building CXX object CMakeFiles/systemshock.dir/src/MacSrc/OpenGL.cc.o
[ 99%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/Xmi.c.o
[ 99%] Building C object CMakeFiles/systemshock.dir/src/MusicSrc/MusicDevice.c.o
[100%] Linking CXX executable systemshock
/usr/lib/libSDL2_mixer.so: referencia a `SDL_RWclose' sin definir
/usr/lib/libSDL2_mixer.so: referencia a `SDL_RWread' sin definir
/usr/lib/libSDL2_mixer.so: referencia a `SDL_RWseek' sin definir
/usr/lib/libSDL2_mixer.so: referencia a `SDL_RWtell' sin definir
collect2: error: ld devolvió el estado de salida 1
CMakeFiles/systemshock.dir/build.make:263: fallo en las instrucciones para el objetivo 'systemshock'
make[2]: *** [systemshock] Error 1
CMakeFiles/Makefile2:189: fallo en las instrucciones para el objetivo 'CMakeFiles/systemshock.dir/all'
make[1]: *** [CMakeFiles/systemshock.dir/all] Error 2
Makefile:102: fallo en las instrucciones para el objetivo 'all'
make: *** [all] Error 2

and now i have the follow dunno, why in the before try, the make try to use /usr/lib64 (64 Bits Native libs), and now try to use /usr/lib (32 Bits native libs) ?

Then the problem is the 32 Bits lib, this source code can not be 100% 64 Bits native ?

Gerwin2k commented 2 years ago

I compiled it succesfully for linux x64 the other day. There was a problem with the build_deps.sh script. The 4th line should read this version of SDL: SDL_version=2.0.10 Otherwise a linker error will occur.

inukaze commented 2 years ago

Well i think the problem is the readme is not specify explicit the options for cmake, i had notice i make mistakes using it xD.

cmake -DENABLE_SDL2=ON -DENABLE_SOUND=ON -DENABLE_DEBUG_BLIT=ON . make

Make Output :

[ 98%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/SDLSound.c.o
[ 98%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/Modding.c.o
[ 99%] Building CXX object CMakeFiles/systemshock.dir/src/MacSrc/OpenGL.cc.o
[ 99%] Building C object CMakeFiles/systemshock.dir/src/MacSrc/Xmi.c.o
[ 99%] Building C object CMakeFiles/systemshock.dir/src/MusicSrc/MusicDevice.c.o
[100%] Linking CXX executable systemshock
[100%] Built target systemshock

ldd ./systemshock Ldd output :

    linux-vdso.so.1 (0x00007fff81986000)
    libSDL2_mixer-2.0.so.0 => /usr/lib64/libSDL2_mixer-2.0.so.0 (0x00007f010d500000)
    libSDL2-2.0.so.0 => /usr/lib64/libSDL2-2.0.so.0 (0x00007f010d13c000)
    libfluidsynth.so.2 => /usr/lib64/libfluidsynth.so.2 (0x00007f010ce79000)
    libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f010cb5c000)
    libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x00007f010c8de000)
    libasound.so.2 => /usr/lib64/libasound.so.2 (0x00007f010c5da000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f010c25e000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f010bf55000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f010bd3d000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f010b974000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f010b757000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f010b552000)
    libdbus-1.so.3 => /usr/lib64/libdbus-1.so.3 (0x00007f010b303000)
    libibus-1.0.so.5 => /usr/lib64/libibus-1.0.so.5 (0x00007f010b09b000)
    libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007f010ad1d000)
    libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f010aacc000)
    libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f010a795000)
    libunwind.so.8 => /usr/lib64/libunwind.so.8 (0x00007f010a57a000)
    libunwind-x86_64.so.8 => /usr/lib64/libunwind-x86_64.so.8 (0x00007f010a35b000)
    libtermcap.so.2 => /lib64/libtermcap.so.2 (0x00007f010a158000)
    libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f0109f55000)
    libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f0109d51000)
    libjack.so.0 => /usr/lib64/libjack.so.0 (0x00007f0109b07000)
    libportaudio.so.2 => /usr/lib64/libportaudio.so.2 (0x00007f01098d6000)
    libsndfile.so.1 => /usr/lib64/libsndfile.so.1 (0x00007f0109661000)
    libreadline.so.6 => /usr/lib64/libreadline.so.6 (0x00007f0109418000)
    libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007f01091f5000)
    libnvidia-tls.so.304.137 => /usr/lib64/tls/libnvidia-tls.so.304.137 (0x00007f0108ff2000)
    libnvidia-glcore.so.304.137 => /usr/lib64/libnvidia-glcore.so.304.137 (0x00007f0106c08000)
    libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f01068cb000)
    libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f01066b9000)
    libglapi.so.0 => /usr/lib64/libglapi.so.0 (0x00007f010648b000)
    libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007f0106288000)
    libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007f0106082000)
    libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 (0x00007f0105e80000)
    libxcb-glx.so.0 => /usr/lib64/libxcb-glx.so.0 (0x00007f0105c69000)
    libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x00007f0105a64000)
    libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f0105845000)
    libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f0105641000)
    libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f010543c000)
    libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007f010522e000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f0105025000)
    /lib64/ld-linux-x86-64.so.2 (0x000055ea39148000)
    libz.so.1 => /usr/lib64/../lib64/libz.so.1 (0x00007f0104e0e000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f0104bf2000)
    libffi.so.6 => /usr/lib64/../lib64/libffi.so.6 (0x00007f01049ea000)
    liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f01047c4000)
    libopus.so.0 => /usr/lib64/libopus.so.0 (0x00007f0104567000)
    libdb-4.8.so => /lib64/libdb-4.8.so (0x00007f01041f1000)
    libFLAC.so.8 => /usr/lib64/libFLAC.so.8 (0x00007f0103f87000)
    libogg.so.0 => /usr/lib64/libogg.so.0 (0x00007f0103d81000)
    libvorbis.so.0 => /usr/lib64/libvorbis.so.0 (0x00007f0103b55000)
    libvorbisenc.so.2 => /usr/lib64/libvorbisenc.so.2 (0x00007f01038ab000)

The README.MD just say

The following CMake options are supported in the build process:
* `ENABLE_SDL2` - use system or bundled SDL2 (ON/BUNDLED, default BUNDLED)
* `ENABLE_SOUND` - enable sound support (requires SDL2_mixer, ON/BUNDLED/OFF, default is BUNDLED)
* `ENABLE_FLUIDSYNTH` - enable FluidSynth MIDI support (ON/BUNDLED/OFF, default is BUNDLED)
* `ENABLE_OPENGL` - enable OpenGL support (ON/OFF, default ON)

but not had any example how use that parameters.