I will list here the problems I meet while trying to build SDL_Mixer_X (standalone, as I am not not interested in the whole PGE project at the moment).
My remarks are based on today's git version.
Let's start with the first one I hit.
Problem with Opus
I run
cmake,
it detects Opus positively:Code: Select all
~/extsvn/SDL-Mixer-X.git/trunk/build $cmake .. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
AudioCodecs will NOT be used. Libraries will be recognized in the system.
== SDL2: /usr/local/include/SDL2 SDL2 ==
Vorbis: /usr/local/include /usr/local/lib/libvorbis.so
== using Vorbis ==
Opus: /usr/local/include /usr/local/lib/libopusfile.so /usr/local/lib/libopusfile.so
== using Opus ==
FLAC: /usr/local/include /usr/local/lib/libFLAC.so
== using FLAC ==
MAD: /usr/local/include /usr/local/lib/libmad.so
== using MAD ==
ModPlug: /usr/local/include /usr/local/lib/libmodplug.so
== using libModPlug ==
GME: LIBGME_INCLUDE_DIR-NOTFOUND LIBGME_LIB-NOTFOUND
== using CMD Music ==
ADLMIDI: LIBADLMIDI_INCLUDE_DIR-NOTFOUND LIBADLMIDI_LIB-NOTFOUND
OPNMIDI: LIBOPNMIDI_INCLUDE_DIR-NOTFOUND LIBOPNMIDI_LIB-NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build
But when I run
make
after that, it failsCode: Select all
~/extsvn/SDL-Mixer-X.git/trunk/build $make
/usr/local/bin/cmake -H/home/stephane/extsvn/SDL-Mixer-X.git/trunk -B/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build/CMakeFiles /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make -f CMakeFiles/SDL2_mixer_ext_Static.dir/build.make CMakeFiles/SDL2_mixer_ext_Static.dir/depend
make[2]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
cd /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/stephane/extsvn/SDL-Mixer-X.git/trunk /home/stephane/extsvn/SDL-Mixer-X.git/trunk /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build/CMakeFiles/SDL2_mixer_ext_Static.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make -f CMakeFiles/SDL2_mixer_ext_Static.dir/build.make CMakeFiles/SDL2_mixer_ext_Static.dir/build
make[2]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
[ 2%] Building C object CMakeFiles/SDL2_mixer_ext_Static.dir/src/codecs/music_opus.c.o
/usr/bin/cc -DFLAC__NO_DLL -DHAVE_FORK -DHAVE_INTTYPES_H -DHAVE_SETENV -DHAVE_SINF -DMODPLUG_STATIC -DMUSIC_CMD -DMUSIC_FLAC -DMUSIC_MOD_MODPLUG -DMUSIC_MP3_MAD -DMUSIC_MP3_MAD_GPL_DITHERING -DMUSIC_OGG -DMUSIC_OPUS -DMUSIC_WAV -DPIC -D_POSIX_C_SOURCE=1 -D_REENTRANT -D_USE_MATH_DEFINES -Dmain=SDL_main -I/home/stephane/extsvn/SDL-Mixer-X.git/trunk/include/SDL_mixer_ext -I/home/stephane/extsvn/SDL-Mixer-X.git/trunk/src -I/home/stephane/extsvn/SDL-Mixer-X.git/trunk/src/codecs -I/include/SDL2 -I/home/stephane/extsvn/SDL-Mixer-X.git/trunk/include -I/usr/local/include/SDL2 -I/libogg/include -I/libvorbis/include -Wall -std=c90 -O3 -DNDEBUG -o CMakeFiles/SDL2_mixer_ext_Static.dir/src/codecs/music_opus.c.o -c /home/stephane/extsvn/SDL-Mixer-X.git/trunk/src/codecs/music_opus.c
In file included from /home/stephane/extsvn/SDL-Mixer-X.git/trunk/src/codecs/music_opus.c:33:0:
/usr/local/include/opus/opusfile.h:110:31: fatal error: opus_multistream.h: No such file or directory
# include <opus_multistream.h>
^
compilation terminated.
make[2]: *** [CMakeFiles/SDL2_mixer_ext_Static.dir/build.make:162: CMakeFiles/SDL2_mixer_ext_Static.dir/src/codecs/music_opus.c.o] Error 1
make[2]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make[1]: *** [CMakeFiles/Makefile2:71: CMakeFiles/SDL2_mixer_ext_Static.dir/all] Error 2
make[1]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make: *** [Makefile:133: all] Error 2
The problem is that
/usr/local/include/opus
is not among the paths given to the compiler. As long as C files #include "opus/something.h"
, it is still OK, but when a C file (in this case, the system /usr/local/include/opus/opusfile.h
) #includes directly <something.h>
, it cannot work.I am not sure why you don't use
pkg-config
in your CMake configuration.It provides the correct paths:
Code: Select all
~/extsvn/SDL-Mixer-X.git/trunk/build $pkg-config --cflags opusfile
-I/usr/local/include/opus -I/usr/local/include -I/usr/local/include/opus
I know nothing about Cmake, so I cannot fix it properly, but I see that you already use
pkg-config
for SDL2, so I imagine it should be possible to use it for other libraries too?Deprecated / ADLMIDI / OPNMIDI
OK, let's skip the Opus thing for now:
Code: Select all
~/extsvn/SDL-Mixer-X.git/trunk/build $cmake .. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DUSE_OPUS=OFF
-- The C compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
== Using default build configuration which is a Release!
AudioCodecs will NOT be used. Libraries will be recognized in the system.
-- Checking for module 'sdl2'
-- Found sdl2, version 2.0.8
== SDL2: /usr/local/include/SDL2 SDL2 ==
-- Looking for ov_open in vorbisfile
-- Looking for ov_open in vorbisfile - found
Vorbis: /usr/local/include /usr/local/lib/libvorbis.so
== using Vorbis ==
-- Looking for FLAC__format_sample_rate_is_valid in FLAC
-- Looking for FLAC__format_sample_rate_is_valid in FLAC - found
FLAC: /usr/local/include /usr/local/lib/libFLAC.so
== using FLAC ==
-- Looking for mad_frame_init in mad
-- Looking for mad_frame_init in mad - found
MAD: /usr/local/include /usr/local/lib/libmad.so
== using MAD ==
-- Looking for ModPlug_Load in modplug
-- Looking for ModPlug_Load in modplug - found
ModPlug: /usr/local/include /usr/local/lib/libmodplug.so
== using libModPlug ==
-- Looking for gme_load_file in gme
-- Looking for gme_load_file in gme - not found
GME: LIBGME_INCLUDE_DIR-NOTFOUND LIBGME_LIB-NOTFOUND
== using CMD Music ==
-- Looking for fork
-- Looking for fork - found
-- Looking for adl_init in ADLMIDI
-- Looking for adl_init in ADLMIDI - not found
ADLMIDI: LIBADLMIDI_INCLUDE_DIR-NOTFOUND LIBADLMIDI_LIB-NOTFOUND
-- Looking for opn_init in OPNMIDI
-- Looking for opn_init in OPNMIDI - not found
OPNMIDI: LIBOPNMIDI_INCLUDE_DIR-NOTFOUND LIBOPNMIDI_LIB-NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build
It doesn't find ADLMIDI and OPNMIDI, that's normal. It still generates a Makefile as if it was OK to do without them.
But then when building,
make
fails:Code: Select all
~/extsvn/SDL-Mixer-X.git/trunk/build $make
/usr/local/bin/cmake -H/home/stephane/extsvn/SDL-Mixer-X.git/trunk -B/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build/CMakeFiles /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make -f CMakeFiles/SDL2_mixer_ext_Static.dir/build.make CMakeFiles/SDL2_mixer_ext_Static.dir/depend
make[2]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
cd /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/stephane/extsvn/SDL-Mixer-X.git/trunk /home/stephane/extsvn/SDL-Mixer-X.git/trunk /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build/CMakeFiles/SDL2_mixer_ext_Static.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make -f CMakeFiles/SDL2_mixer_ext_Static.dir/build.make CMakeFiles/SDL2_mixer_ext_Static.dir/build
make[2]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make[2]: Nothing to be done for 'CMakeFiles/SDL2_mixer_ext_Static.dir/build'.
make[2]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
[ 50%] Built target SDL2_mixer_ext_Static
make -f CMakeFiles/SDL2_mixer_ext.dir/build.make CMakeFiles/SDL2_mixer_ext.dir/depend
make[2]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
cd /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/stephane/extsvn/SDL-Mixer-X.git/trunk /home/stephane/extsvn/SDL-Mixer-X.git/trunk /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build /home/stephane/extsvn/SDL-Mixer-X.git/trunk/build/CMakeFiles/SDL2_mixer_ext.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make -f CMakeFiles/SDL2_mixer_ext.dir/build.make CMakeFiles/SDL2_mixer_ext.dir/build
make[2]: Entering directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
[ 53%] Linking C shared library lib/libSDL2_mixer_ext.so
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/SDL2_mixer_ext.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -Wall -std=c90 -O3 -DNDEBUG -Wl,--no-undefined -shared -Wl,-soname,libSDL2_mixer_ext.so -o lib/libSDL2_mixer_ext.so CMakeFiles/SDL2_mixer_ext.dir/src/codecs/load_aiff.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/load_voc.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/music_wav.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/music_ogg.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/music_flac.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/music_mad.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/music_id3tag.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/music_modplug.c.o CMakeFiles/SDL2_mixer_ext.dir/src/codecs/music_cmd.c.o CMakeFiles/SDL2_mixer_ext.dir/src/effect_position.c.o CMakeFiles/SDL2_mixer_ext.dir/src/effects_internal.c.o CMakeFiles/SDL2_mixer_ext.dir/src/effect_stereoreverse.c.o CMakeFiles/SDL2_mixer_ext.dir/src/mixer.c.o CMakeFiles/SDL2_mixer_ext.dir/src/music.c.o CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o -Wl,-rpath,/usr/local/lib: -lSDL2 /usr/local/lib/libvorbisfile.so /usr/local/lib/libvorbis.so /usr/local/lib/libFLAC.so /usr/local/lib/libogg.so /usr/local/lib/libmad.so /usr/local/lib/libmodplug.so /usr/local/lib/libSDL2.so -lstdc++
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_Timidity_addToPathList':
mixer_x_deprecated.c:(.text+0x1): undefined reference to `Mix_Timidity_addToPathList'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getBankNames':
mixer_x_deprecated.c:(.text+0x11): undefined reference to `Mix_ADLMIDI_getBankNames'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getBankID':
mixer_x_deprecated.c:(.text+0x21): undefined reference to `Mix_ADLMIDI_getBankID'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setBankID':
mixer_x_deprecated.c:(.text+0x31): undefined reference to `Mix_ADLMIDI_setBankID'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getTremolo':
mixer_x_deprecated.c:(.text+0x41): undefined reference to `Mix_ADLMIDI_getTremolo'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setTremolo':
mixer_x_deprecated.c:(.text+0x51): undefined reference to `Mix_ADLMIDI_setTremolo'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getVibrato':
mixer_x_deprecated.c:(.text+0x61): undefined reference to `Mix_ADLMIDI_getVibrato'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setVibrato':
mixer_x_deprecated.c:(.text+0x71): undefined reference to `Mix_ADLMIDI_setVibrato'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getScaleMod':
mixer_x_deprecated.c:(.text+0x81): undefined reference to `Mix_ADLMIDI_getScaleMod'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setScaleMod':
mixer_x_deprecated.c:(.text+0x91): undefined reference to `Mix_ADLMIDI_setScaleMod'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getAdLibMode':
mixer_x_deprecated.c:(.text+0xa1): undefined reference to `Mix_ADLMIDI_getAdLibMode'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setAdLibMode':
mixer_x_deprecated.c:(.text+0xb1): undefined reference to `Mix_ADLMIDI_setAdLibMode'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setSetDefaults':
mixer_x_deprecated.c:(.text+0xc1): undefined reference to `Mix_ADLMIDI_setSetDefaults'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getLogarithmicVolumes':
mixer_x_deprecated.c:(.text+0xd1): undefined reference to `Mix_ADLMIDI_getLogarithmicVolumes'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setLogarithmicVolumes':
mixer_x_deprecated.c:(.text+0xe1): undefined reference to `Mix_ADLMIDI_setLogarithmicVolumes'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_getVolumeModel':
mixer_x_deprecated.c:(.text+0xf1): undefined reference to `Mix_ADLMIDI_getVolumeModel'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_ADLMIDI_setVolumeModel':
mixer_x_deprecated.c:(.text+0x101): undefined reference to `Mix_ADLMIDI_setVolumeModel'
CMakeFiles/SDL2_mixer_ext.dir/src/mixer_x_deprecated.c.o: In function `MIX_OPNMIDI_setCustomBankFile':
mixer_x_deprecated.c:(.text+0x111): undefined reference to `Mix_OPNMIDI_setCustomBankFile'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/SDL2_mixer_ext.dir/build.make:469: lib/libSDL2_mixer_ext.so] Error 1
make[2]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/SDL2_mixer_ext.dir/all] Error 2
make[1]: Leaving directory '/home/stephane/extsvn/SDL-Mixer-X.git/trunk/build'
make: *** [Makefile:133: all] Error 2
Because it still tried to compile and link function related to ADLMIDI and OPNMIDI, despite having detected that they were not present.
I guess CMake should either:
- refuse to go on when ADLMIDI or OPNMIDI are missing, if they are truly required;
- or generate a Makefile which won't build parts related to ADLMIDI and OPNMIDI, if those parts are optional.
What's your opinion on this?
Explanation of why I am interested in your library (and not coming from an interest in the PGE project).
I found your library after spending time to implement a feature in the official SDL_mixer and finding a few problems in the code of that official library. Then after I did that, I found your project and found out that you had already implemented the same feature I worked on and that your rewrite possibly solved (a few of?) the problems I had found in the official library. So I thought it would be easier to replace the official library with your fork than to struggle with the problems of the original one.
(I tried to post this message yesterday, but it didn't appear after 24 hours, so I post it again; I hope both won't appear at the same time.)