I am making a C++ SDL based game engine, currently doing the AudioManager, the…
- User
I am making a C++ SDL based game engine, currently doing the AudioManager, the SoundEffect and the Music classes. I was using SDL_mixer but then I ran into a dilemma, the sound effects provided by the library (Mix_Chunk) has only WAV support, the only part with MP3 and several other formats is Mix_Music. Would it be hard to implement it in SDL_mixer or should I look to other alternatives like SDL_Mixer_X library, which offers all these formats on the get go but I have to add a new library for it
- Assistant
- User
Is there a way to use SDL_audio to workout these limitations without adding SDL_Mixer_X?
- Assistant
- User
No I think I will just add SDL_Mixer_X library, even though I wanted to use SDL only, I don't like to limit the users to just use WAV when there are so many alternatives. Will be too much overhead to add this library in terms of memory contrains or similar?
- Assistant
- User
perfect, help me add it to my codeblocks project, I don't know what to do since I never added any library and I just used SDL that was provided by the OS
- Assistant
- User
Is there a way to install it on my OS too (opensuse)? I see the original SDL_mixer is installed here for example:
/usr/lib64/libSDL2_mixer-2.0.so.0 /usr/lib64/libSDL2_mixer-2.0.so.0.800.0 /usr/share/doc/packages/libSDL2_mixer-2_0-0 /usr/share/doc/packages/libSDL2_mixer-2_0-0/CHANGES.txt /usr/share/doc/packages/libSDL2_mixer-2_0-0/README.txt /usr/share/licenses/libSDL2_mixer-2_0-0 /usr/share/licenses/libSDL2_mixer-2_0-0/LICENSE.txt
- Assistant
- User
- Assistant
- User
I see, now three more questions:
- will this library show in my YAST software manager?
- To update, will I have to compile it again or can it be done from the YAST software manager or Zypper automatically?
- When I distribute the releease of my project, in a dynamic linking I will have to copy and paste the library .so file into my executable directory?
- Assistant
- User
Since my application will be another library, .so or .dll and I can't package it, then I would want to copy it to the release directory, but what if I want to define the library path as libs for release but not when compiling in codeblocks, I want it to look in an specific folder but if they don't exist I want them to be looked out in the system directory
- Assistant
- User
I plan on distributing like this:
libMyEngine.so SDL.so SDL_image.so ... SDL_mixer_ext.so ...
So the user will have to link libMyEngine.so only to their game project and nothing else, and then compile their project with my library and work from there, and automatically find the other libraries whether they are in the same folder or system wide folder.
For this what is the easiest way, setting a LD_LIBRARY_PATH by my library or something else?
- Assistant
- User
Cmake is giving me errors, I thought the library didn't anything external but itself:
cmake -DCMAKE_BUILD_TYPE=Release .. -- The C compiler identification is GNU 13.2.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Configuring SDL2_mixer 2.8.0 -- Performing Test HAVE_WL_NO_UNDEFINED -- Performing Test HAVE_WL_NO_UNDEFINED - Success -- Looking for fork -- Looking for fork - found -- Using system opusfile CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find OpusFile (missing: OpusFile_LIBRARY OpusFile_INCLUDE_PATH) Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) cmake/FindOpusFile.cmake:29 (find_package_handle_standard_args) CMakeLists.txt:417 (find_package)
-- Configuring incomplete, errors occurred!
- Assistant
- User
If I download the opus library, will I have to ship it with my own library or not? maybe compiling the library as static to mix everything in the same .so file but it will be larger that way right?
- Assistant
- User
will cmake make the sdl mixer x library static or dynamic?
- Assistant
- User
Ok I ended up installing it, but now is giving me an error even though I already have the required library installed:
Here is the installed libxmp.so. libxmp4 - Module Player library for MOD, S3M, IT and others
/usr/lib64/libxmp.so.4 /usr/lib64/libxmp.so.4.6.0 /usr/share/licenses/libxmp4 /usr/share/licenses/libxmp4/COPYING.LIB
Here is the error: -- Using system FluidSynth CMake Error at /usr/lib64/cmake/fluidsynth/FluidSynthTargets.cmake:103 (message): The imported target "FluidSynth::fluidsynth" references the file
"/usr/bin/fluidsynth"but this file does not exist. Possible reasons include:
-
The file was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and contained
"/usr/lib64/cmake/fluidsynth/FluidSynthTargets.cmake"
but not all the files it references.
Call Stack (most recent call first): /usr/lib64/cmake/fluidsynth/FluidSynthConfig.cmake:148 (include) CMakeLists.txt:782 (find_package)
-
- Assistant
- User
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.