Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0125-preview· OpenAIAi2 WildChat-4.8M (AI2)

I am making a C++ SDL based game engine, currently installing SDL mixer X, because it…

  1. User

    I am making a C++ SDL based game engine, currently installing SDL mixer X, because it supports more formats. It asked several dependencies which I installed but then after compiling the .so file doesn't show them, why is this?

    $ make -j 4 [ 2%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_cmd.c.o [ 10%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/load_aiff.c.o [ 10%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/load_voc.c.o [ 10%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/mp3utils.c.o [ 12%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_drflac.c.o [ 15%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_flac.c.o [ 17%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_fluidsynth.c.o [ 20%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_gme.c.o [ 23%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_minimp3.c.o [ 25%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_modplug.c.o [ 28%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_mpg123.c.o [ 30%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_nativemidi.c.o [ 33%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_ogg.c.o [ 35%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_ogg_stb.c.o [ 38%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_opus.c.o [ 41%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_timidity.c.o [ 43%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_wav.c.o [ 46%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_wavpack.c.o [ 48%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/music_xmp.c.o [ 51%] Building C object CMakeFiles/SDL2_mixer.dir/src/effect_position.c.o [ 53%] Building C object CMakeFiles/SDL2_mixer.dir/src/effect_stereoreverse.c.o [ 56%] Building C object CMakeFiles/SDL2_mixer.dir/src/effects_internal.c.o [ 58%] Building C object CMakeFiles/SDL2_mixer.dir/src/mixer.c.o [ 61%] Building C object CMakeFiles/SDL2_mixer.dir/src/music.c.o [ 64%] Building C object CMakeFiles/SDL2_mixer.dir/src/utils.c.o [ 66%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/common.c.o [ 69%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/instrum.c.o [ 71%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/mix.c.o [ 74%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/output.c.o [ 76%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/playmidi.c.o [ 79%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/readmidi.c.o [ 82%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/resample.c.o [ 84%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/tables.c.o [ 87%] Building C object CMakeFiles/SDL2_mixer.dir/src/codecs/timidity/timidity.c.o [ 89%] Linking C shared library libSDL2_mixer-2.0.so [ 89%] Built target SDL2_mixer [ 92%] Building C object CMakeFiles/playmus.dir/playmus.c.o [ 94%] Building C object CMakeFiles/playwave.dir/playwave.c.o [ 97%] Linking C executable playwave [100%] Linking C executable playmus [100%] Built target playwave [100%] Built target playmus

    $ ldd libSDL2_mixer.so linux-vdso.so.1 (0x00007fffe075a000) libSDL2-2.0.so.0 => /lib64/libSDL2-2.0.so.0 (0x00007f7b007e6000) libc.so.6 => /lib64/libc.so.6 (0x00007f7b00400000) libasound.so.2 => /lib64/libasound.so.2 (0x00007f7b006dc000) libm.so.6 => /lib64/libm.so.6 (0x00007f7b00319000) /lib64/ld-linux-x86-64.so.2 (0x00007f7b00a53000)

  2. Assistant

    The behavior you're seeing with ldd not showing the dependencies expected from the additional codecs and formats supported by SDL Mixer X could stem from a few different scenarios. Here are some points to consider that might help explain and guide you to a solution:

    1. Static Linking of Dependencies

    If SDL Mixer X (or certain codecs within it) statically links to some of its dependencies, rather than dynamically linking, those dependencies won't show up in the output of ldd. Static linking involves incorporating the library code directly into the binary (in this case, libSDL2_mixer.so), so there are no dynamic dependencies on those libraries at runtime.

    2. Load-time Dynamic Linking

    Some libraries or frameworks might load other dependency libraries at runtime using functions from the dlopen family, instead of linking against them at compile/link time. This can be common for plugins or modules that extend the functionality of a program or library without requiring those modules to be present at compile time. Again, since these dependencies are not part of the ELF dynamic section, ldd would not list them.

    3. Conditional Compilation

    Features and codecs in SDL Mixer X might be enabled or disabled based on compile-time options or the presence/absence of specific libraries during the build configuration step. Make sure that the build process of SDL Mixer X was configured to enable all the codecs and formats you're interested in, and that the necessary development headers for those codecs were present. You might need to revisit the cmake or configure step and the logs it produced to verify this.

    4. Investigating Further

    You can try a few things to investigate and potentially solve this issue:

    • Reconfiguration: Re-run the configuration step of your build process (e.g., cmake, configure, etc.) and check the output carefully to see if all the codecs and formats you expect are being enabled. Look for messages indicating that certain dependencies were not found or features were not enabled.

    • Verbose Build Output: If supported, make your build process more verbose (make VERBOSE=1 or similar) to see more details about what is being linked and included.

    • Check Build Documentation: Look for any build flags or options specific to enabling the codecs or formats you're interested in. You may need to explicitly enable some features or point the build system to the locations of certain libraries.

    • Dynamically Loading Codecs: If SDL Mixer X uses a plugin architecture for some codecs, ensure that the runtime environment can find these plugins. This could involve setting environment variables or placing plugin files in expected directories.

    Focusing on these aspects could help you diagnose why the additional formats supported by SDL Mixer X aren't being reflected in the build output or runtime dependencies.