When trying to load a wav-file to the mixer of SDL I get an error: undefined reference to `Mix_LoadWAV'. Also, Mix_OpenAudio is complaining that it has too many arguments. I have linked to SDL2.dll and SDL2_mixer.dll. Without the mixer functions, I am able to play a wav-file using SDL.
As pointed out before, "error: undefined reference to XYZ" is a linker error and usually indicates that you are missing a required library: https://cplusplus.com/forum/beginner/285624/
In this particular case, try adding -lSDL2 and maybe -lSDL2_mixer to your linker options. If on Windows/MSVC, try linking SDL2.lib.