libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static build SDL2MIXER_SAMPLES error

jinfeihan57 opened this issue · comments

Version 2.6.3
build option:
set(SDL2MIXER_VENDORED ON)
set(SDL2MIXER_INSTALL OFF)
set(SDL2MIXER_DEPS_SHARED OFF)
2023-10-12_224639

What is the link command?
Also post the contents of the .rsp response files that are used as input.

I assume you are using non-vendored modplug libraries (-DSDL2MIXER_VENDORED=OFF).
We look for modplug using this find module.
Please post the contents of all modplug_* variables in your CMakeCache.txt file.

The above log shows compilation errors in the MSYS2 UCRT64 environment.
Cmake option settings:
image

The following is compiled using MSYS2 CLANG64
MSYS2 clang64 build ENV:
image
.rsp file:
image

If I set(SDL2MIXER_DEPS_SHARED ON), use Dynamically load modplug. It will compiler OK.
But just because the compilation is successful does not indicate that modplug is available.
and I want use static link,not dynamic load.

Thanks for the logs.
Fixed in 32381df and libsdl-org/libmodplug@1e03298
You can fix it in your project by adding the following after add_subdirectory(SDL_mixer)

if(TARGET modplug)
    target_compile_definitions(modplug PUBLIC MODPLUG_STATIC)
endif()